Printersettings

Stimulsoft Reports.NET discussion
Post Reply
vorauler
Posts: 71
Joined: Wed Jul 15, 2009 1:20 am

Printersettings

Post by vorauler »

Hi

I create my report's with this code to view it in the preview window.

Code: Select all

StiReport report = new StiReport();
report.Load(printOptions.ReportFile);

report.PrinterSettings.ShowDialog = true;
report.Compile();
StiOptions.Dictionary.BusinessObjects.MaxLevel = 3;
report.RegData(printOptions.DataSourceName, printOptions.DataSource);

report.Render();
report.ShowWithRibbonGUI();
When I now change some properties of the printer settings like color / black-white or tray, these changes will not affected by the report.
The report is always printed with the default printer settings.

What do I wrong?

TIA
Ralf
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Printersettings

Post by HighAley »

Hello.
vorauler wrote:I create my report's with this code to view it in the preview window.

Code: Select all

StiReport report = new StiReport();
report.Load(printOptions.ReportFile);

report.PrinterSettings.ShowDialog = true;
report.Compile();
StiOptions.Dictionary.BusinessObjects.MaxLevel = 3;
report.RegData(printOptions.DataSourceName, printOptions.DataSource);

report.Render();
report.ShowWithRibbonGUI();
When I now change some properties of the printer settings like color / black-white or tray, these changes will not affected by the report.
The report is always printed with the default printer settings.

What do I wrong?
Please, try to use RegData method before Compile method.

Thank you.
vorauler
Posts: 71
Joined: Wed Jul 15, 2009 1:20 am

Printersettings

Post by vorauler »

Hello

I think I have explained my problem not correctly. Take a look at this picture: http://sdrv.ms/JLhZ7M
My steps are:
- Create the report and preview it
- Click the Print-Button in the preview dialog
- Then click printer settings
- Change for example the color from color to black/white
And now these changes are not affected by the report, the report is always printed with the default printer settings.

TIA Ralf
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Printersettings

Post by HighAley »

Hello.
vorauler wrote:I think I have explained my problem not correctly. Take a look at this picture: http://sdrv.ms/JLhZ7M
My steps are:
- Create the report and preview it
- Click the Print-Button in the preview dialog
- Then click printer settings
- Change for example the color from color to black/white
And now these changes are not affected by the report, the report is always printed with the default printer settings.
PaperSize and PaperSource could be set for each page, so they are set in the report parameters.
If you want to use settings from printer dialog then you should set one of next properties:

Code: Select all

StiOptions.Print.UsePaperSizeAndSourceFromPrintDialogIfTheyChanged = true;
StiOptions.Print.UsePaperSizeAndSourceFromPrintDialogAlways = true;
If you use any specific printer setttings then try to set next property:

Code: Select all

StiOptions.Print.UsePrinterSettingsEntirely = true;
Thank you.
Post Reply