How To Update Printpreview S’abonner

0
Avatar
Legacy Poster

I'm on a roll today with questions,

 

I managed to get my initial print preview working. I then pull the prompts into a dataGrid. After changing the inputs, how do I go about updating the print preview?

6 commentaires

0
Avatar
Domingo Rodriguez
Modérateur
Actions pour les commentaires Permalien

What Edition, version and build of BarTender do you own?

 

Which method(s) are you using to show the print preview for the labels to be printed? How exactly are you assigning the variable data for the label, using the SubString.Value() method?

 

Please take a look as well as the ExportPrintPreviewToImage() method (only available in the Enterprise Automation of BarTender). This method, combined with a BarTender document reading from a database, would give you 1 preview image per database record.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

What Edition, version and build of BarTender do you own?

Which method(s) are you using to show the print preview for the labels to be printed? How exactly are you assigning the variable data for the label, using the SubString.Value() method?

Please take a look as well as the ExportPrintPreviewToImage() method (only available in the Enterprise Automation of BarTender). This method, combined with a BarTender document reading from a database, would give you 1 preview image per database record.

What Edition, version and build of BarTender do you own? I'm using 10.1 SR2 Enterprise Automation

I currently use format.ExportPrintPreviewToFile() method, and the Prompts() object to get the existing promps to a dataGridView. The user will enter values using the dataGrid. I have not tried to write the value to the labels yet.

I cannot find ExportPrintPreviewToImage() method in the documentation, can you give an example of its use? As a matter of fact I do not have that method in my PrintPreview Class.

I might be putting the cart ahead of the horse. Should I change the prompts then call ExportPrintPreview to file last? I currently show the preview and prompt then print.
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I just upgraded to 10.1 SR3 Build 2954, and cannot find that method you've mentioned in the documentation.

0
Avatar
Domingo Rodriguez
Modérateur
Actions pour les commentaires Permalien

I was indeed wanting to refer to the format.ExportPrintPreviewToFile(). The one I mentioned is used in ActiveX Automation and not present within the .NET SDKs. Let's say that your BT document connects to a database with 100 records. At print time, if you would print 1 copy per record and make use of format.ExportPrintPreviewToFile(), 100 images will be generated (each with different variable data on them). 

 

How are you assigning the variable data to be printed? If you're making use of the SubStrings.SetSubString() method, be aware that you will only be able to set the value for one label at a time (so, one set of variable data per print job). This won't be effective if you plan to show a print preview for variable data labels. If you're wanting to set variable data for severals labels in a go, and then export the print preview for the print job to images, then use a database connection instead. 

 

Our .NET SDK Help contains some reference on how this can be setup.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

This is what I came up with to update the prompt from the datagridview

 

 Public Sub demoGrid2_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles demoGrid2.CellEndEdit
        ' Set  prompt's value using its index.
        Dim btPromptsList As Prompts = btFormat.Prompts

        btPromptsList.Item(0).Value = demoGrid2.Rows(0).Cells(1).Value

        MessageBox.Show(btPromptsList.Item(0).Value.ToString) 'TESTING TO SEE WHATS IN PROMPT

    End Sub

I then call my PrintPreview and it updates with the new prompt data. Please let me know if there is a better way to do this!

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Private Sub demoGrid2_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles demoGrid2.CellEndEdit
        ' Set  prompt's value using its index.
        Dim btPromptsList As Prompts = btFormat.Prompts

        Dim index As Integer
        For index = 0 To btPromptsList.Count - 1
            btPromptsList.Item(index).Value = demoGrid2.Rows(index).Cells(1).Value
        Next index


    End Sub

This is the final sub that updates changes to the datagrid!

Vous devez vous connecter pour laisser un commentaire.