Page 1 of 1

Paper Size

Posted: Wed Feb 07, 2007 6:09 pm
by jing
In one of the old forum
shmuly wrote:
Is there a way to create my own paper sizes?

Vital wrote:
You can change page width and page height with propeties grid. You can't change list with predefault page sizes.


shmuly wrote:
Is there a way to specify which tray in the printer each page should print from?

Vital wrote:
At this moment no. We planning release this feature in next version.

Thanks you.
I have a few questions

1) Can you change page width and page height via code (vb. net) ? How?
2) How do you set a printer for the report via code?
2) Can you change the predefault page sizes based on the printer you selected via code?

thanks

Paper Size

Posted: Thu Feb 08, 2007 11:53 am
by Vital
1) Can you change page width and page height via code (vb. net) ? How?
For example:

Code: Select all

Dim Page As StiPage = report.Pages.Item(0)
Page.PageWidth = 21
Page.PageHeight = 29,7
2) How do you set a printer for the report via code?
1. You can use following code:

Code: Select all

report.Print(PrinterSettings)
In PrinterSettings you can specify printer name.

2. You can use property

report.PrinterSettings.PrinterName
3) Can you change the predefault page sizes based on the printer you selected via code?
Can you explain what you mean "predefault page size"?

Thank you.

Paper Size

Posted: Thu Feb 08, 2007 2:40 pm
by jing
Can you explain what you mean "predefault page size"?
I mean the drop down list in the page setup when you are in the Designer. It populates with things like A4, Letter etc.

The reason I ask is because I am trying to set the default printer to a label printer. I can setup the paper sizes via the label printer, so I am wondering whether I can populate that "predefault page size" list in the Designer, with the setup from the label printer...


thanks

Paper Size

Posted: Fri Feb 09, 2007 12:39 pm
by Vital
We use following code for fill list of page sizes:

Code: Select all

PrinterSettings printerSetting = new PrinterSettings();

foreach (PaperSize ps in printerSetting.PaperSizes)
...
So you see list of page sizes from default printer.
We have added new static property StiOptions.Print.CustomPaperSizes. You can assign your own collection of paper sizes to this property.
New property will be available in build from 12 Feb. For also you can request latest version at support [at] stimulsoft [dot] com.

Thank you.

Paper Size

Posted: Sun Feb 11, 2007 5:42 pm
by jing
I have tried the following code when making the designer "report"

Code: Select all

    Dim Page As StiPage = report.Pages.Item(0)


            Dim printerSetting As New PrinterSettings()
            printerSetting.PrinterName = "Datamax E-4203"

            StiOptions.Print.CustomPaperSizes = printerSetting.PaperSizes


            For Each ps As PaperSize In printerSetting.PaperSizes
                Page.PageWidth = ps.Width
                Page.PageHeight = ps.Height

                Dim margin As New StiMargins(printerSetting.DefaultPageSettings.Margins.Left, printerSetting.DefaultPageSettings.Margins.Right, printerSetting.DefaultPageSettings.Margins.Top, printerSetting.DefaultPageSettings.Margins.Bottom)

                Page.Margins = margin
            Next

The designer runs fine and the "Predefault page size" were listed, but when I try to change the predefault page size using the drop down box, an error occured
"Index was outside the bounds of the array"

Any help please?

thanks

Paper Size

Posted: Mon Feb 12, 2007 9:28 am
by Edward
The designer runs fine and the "Predefault page size" were listed, but when I try to change the predefault page size using the drop down box, an error occured
"Index was outside the bounds of the array"
Fixed.

Please take the build from the February, 12.

Please use appropriate unit conversion in the following string:

Code: Select all

Page.PageWidth = ps.Width
So if the report unit is inches you need transform your code as following:

Code: Select all

Page.PageWidth = ps.Width/100
Thank you.

Paper Size

Posted: Mon Feb 12, 2007 1:40 pm
by jing
Quote:
The designer runs fine and the "Predefault page size" were listed, but when I try to change the predefault page size using the drop down box, an error occured
"Index was outside the bounds of the array"

Fixed.
I have took the build from Feb 12 and copied the files and recompiled my program... Still the same error message when I use the drop down box ....??




Paper Size

Posted: Wed Feb 14, 2007 6:16 am
by Edward
Please send an example Application to Image

We still not able to reproduce error after fix.

Thank you.

Paper Size

Posted: Thu Feb 15, 2007 10:16 am
by Vital
Please check build from 15 Feb.
Thank you.