How To Update Printpreview
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?
-
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 -
Legacy Poster
★ BarTender Hero ★
What Edition, version and build of BarTender do you own? I'm using 10.1 SR2 Enterprise AutomationWhat 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.
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 -
Legacy Poster
★ BarTender Hero ★
I just upgraded to 10.1 SR3 Build 2954, and cannot find that method you've mentioned in the documentation.
0 -
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 -
Legacy Poster
★ BarTender Hero ★
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 -
Legacy Poster
★ BarTender Hero ★
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!
0
請登入寫評論。
評論
6 條評論