Hi Brad,
Not sure if you are already using it, but I got around printing issues by
using the Report Item (which you get from the Project Menu/Add New Item - the
select the Report Item from the list of items - same list that contains
Forms, Icons...). This will create an RDLC Item (very similar to a Reporting
Services RDL file). Note: this is not the Report control from the toolbox -
although the Report control uses an RDLC (I think if you select the Report
control from the toolbox - it automatically creates an RDLC Item).
In the RDLC you set up your Layout that you want to print out. I have had
pretty good luck with this so far. I also found that the RDLC file will work
better if you create a persistent table in your project (not a table created
on the fly). I create a persistent dataset in the dataSources tab but I
don't select any tables from the server. Then I add my own table (my
persistent table) to the Design view of the dataset in the DataSources tab.
Then when you add controls to the RDLC - textboxes, tables,... you bind the
table fields to the controls by dragging the table field from your persistent
table to the desired control. Then just populate that table as you need, the
same way you populate any table in a dataset.
HTH
Rich
"Brad Pears" wrote:
Quote:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default printer settings to print.
>
I wanted the print preview to appear the same for all users (i.e. a default page size of 8.5x14 (legal) and portrait mode). Many users have different printers as their default (plotters etc..) and I found that various users were having problems viewing the entire drawing - depending on the selected default printer.
>
So, to accomplish this I used the below commands to set a custom paper size and set landscape off before viewing the print preview dialog...
>
It works just fine for viewing but when the user clicks the printer icon, the print job appears to be displaying only a small part of the drawing as if it has zoomed way in. There is simply a soliod thick black line - which appears to possibly be a part of the drawing. After some quick testing - I determined that the line of code causing this problem is the line where I am setting the custom page size. if I comment this line out, it is fine - except I am back to the old problem of users viewing the drawing based on their currently selected printer - which may cause a screw up with the viewing...
>
Does anyone have any ideas on this one??
>
Thanks, Brad
------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Set default paper size to legal size using a custom form (length/width dimensions are in 1000's of an inch)
>
dlgPrintPreview.Document.DefaultPageSettings.Paper Size = New Printing.PaperSize("Custom", 8500, 14000)
>
' Ensure portrait printing by setting landscape as false
>
dlgPrintPreview.Document.DefaultPageSettings.Lands cape = False
>
' Show it!
>
dlgPrintPreview.ShowDialog()
>
-----------------------------------------------------------------------------------------------------
>
>