Posted 4 April 2019, 3:25 pm EST
I am having all manner of problems trying to get simple labels to print correctly with C1FlexReport. The printer in Question is a label printer than prints 2 1/4" wide by 1 1/4" high labels on a continuous sheet. Here are the issues that I am having:
-
I specifically set the length and width properties of the report to the correct size but could not find any way of setting the paper size property. If I clicked the page Setup button on the designer, the nearest I can get is selected Custom paper size but it gives no means of entering the paper size and it resets to letter every time you click the button anyway.
-
When I open the report preview in the FlexViewer, it appears as letter size paper oriented landscape even though I explicitly set the orientation to portrait. I assume this is because the width is greater than the height of the label but when the label is oriented portrait it IS wider than it is high. I even used the following code to force it to portrait:
C1FlexReport1.PageSettings.Landscape = False C1FlexReport1.Layout.Orientation = OrientationEnum.Portrait
That works until I select the label printer and then it resets to landscape.
-
Once I select the label printer, it keeps the letter size paper size setting rather than changing to the paper size actually specified in the printer settings itself. I have to click Page setup. There is then a delay of about 30 seconds and then I have to manually choose the correct paper size - it always ignores the printer setting and defaults to the first one in the list.
-
Once you select a paper size, it again resets to landscape rather than portrait.
To get my labels to print correctly, users are forced to:
- Hit the print button to get the preview.
- Click Print report in the FlexViewer.
- Select the correct printer.
- Click Apply.
- Click Cancel
- Click Page setup and select the correct paper size (defaults to letter size regardless of the paper size setting in the printer.)
- Click Ok.
- Click Print Report again.
- Set the orientation back to portrait (it ignores or overrides the printer default and flips to landscape on it own).
10 Click Print.
Any help would be appreciated. This thing seems to be fighting me at every turn. Basically I need to:
-
Set the paper size in code at design time and have that paper size be selected in the FlexViewer without user intervention.
-
Have it orient to Portrait and not landscape as per the settings I did in code and the settings of the printer.
-
Allow the user to change from the default printer to the label printer without it losing all of the above settings and defaulting to letter size paper landscape oriented.