We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ReportViewer disperse elements when printing

Thread ID:

Created:

Updated:

Platform:

Replies:

131890 Aug 1,2017 07:56 PM UTC Aug 15,2017 03:37 PM UTC WPF 15
loading
Tags: ReportViewer
BELADEL ILYES ABDELRAZAK
Asked On August 1, 2017 07:56 PM UTC

Hello,
I have created an Arabic report and when I view it I noticed some bugs after few tests:
1) The element will miss their original positions(Not too much).
2) In the ReportDesigner, if I place an element like TextBlock near the bottom and then lunch it a new page will appear, but if I reopen the ReportDesigner then lunch the preview no more page created.
3) When the report in preview mode, if I click on Print layout button, few blank pages add, more precisely, after each page in my report a new blank page added, in my case 02 blank pages were add.

In the attachment you will find a simple project to reproduce the bugs I mentioned.

My setup environment:
Screen resolution: 1920x1080, 23".
Visual studio 2017 community edition 15.2 (26430.16)
Essential Studio WPF version v15.2.0.46 (SP2)

Attachment: SimpleReport_b6354e9e.zip

Vinoth Srinivasan [Syncfusion]
Replied On August 2, 2017 12:48 PM UTC

Hi BELADEL, 
 
Thanks for contacting Syncfusion Support. 
 
Query 
Response 
1) The element will miss their original positions(Not too much). 
2) In the ReportDesigner, if I place an element like TextBlock near the bottom and then lunch it a new page will appear, but if I reopen the ReportDesigner then lunch the preview no more page created. 
3) When the report in preview mode, if I click on Print layout button, few blank pages add, more precisely, after each page in my report a new blank page added, in my case 02 blank pages were add. 
The extra blank page added due to the sum of report body width and margin exceeds the Report page width). As per MS layout when report width is lesser than the (Body Width + (Left Margin + Right Margin)), an additional page will be added in print layout. Kindly reduce body width or increase page width in order to avoid the extra blank pages. Please refer the following link for further details. 
 
Also, we have modified your report based on this and it can be downloaded from the following link. 
 
 
Regards, 
Vinoth S. 


BELADEL ILYES ABDELRAZAK
Replied On August 2, 2017 06:48 PM UTC

Thanks Mr Vinoth for this quick replay, and I am sorry to mark this as a bug.

I checked the article you mentioned plus the article the other guy mentioned too(http://sqlblog.com/blogs/stacia_misner/archive/2011/03/18/34259.aspx), but still don't get how to calculate and set the margins.

Also, how I can set a page break. so other details will be printed in a second page, currently as a temporary solution, I set the report double high, then in the second half  place the object but this is not a practical solution.


Vinoth Srinivasan [Syncfusion]
Replied On August 3, 2017 02:15 PM UTC

Hi BELADEL, 
 
Query 
Response 
I checked the article you mentioned plus the article the other guy mentioned too(http://sqlblog.com/blogs/stacia_misner/archive/2011/03/18/34259.aspx), but still don't get how to calculate and set the margins. 
As we updated earlier, when the sum of body size and margin value exceeds report size blank page will occur, so you have to design the report based on the report page size. In your report the report BodyWidth=11.5in, Margin=0in and ReportWidth=8.5in, as per RDL layout calculation (BodyWidth(11.5in)+Margin(0in)>ReportWidth(8.5in)) , so extra blank pages added. You have to reduce the BodyWidth(11.5in) in your report to make BodyWidth(11.5in)+Margin(0in)<=ReportWidth=8.5in. Please find the below snap of your unmodified report in which the body size is greater than report size.  
 
 
 
 
 
 
 
 
 
Also, how I can set a page break. so other details will be printed in a second page, currently as a temporary solution, I set the report double high, then in the second half  place the object but this is not a practical solution. 
You can set “Page Break” from report item properties to the tablix and rectangle report item in our report designer. Please refer the below MSDN link for more details. 
 
 
 
Regards, 
Vinoth S. 


BELADEL ILYES ABDELRAZAK
Replied On August 4, 2017 01:54 AM UTC

Hi Vinoth again ;),

Making the diffrence between BodyReport and the report itself solves to me many future issues.

Now, I have another question, while I get to separate each report details in independent page, after printing it in paper or PDF, I see a lot of empty space, it's like the report resized and get printed in half page. 

UPDATE:

After I sent to the printer, the report got resized too tiny.


Attachment: 9takrirtarbawi16_5df65845.zip

Vinoth Srinivasan [Syncfusion]
Replied On August 4, 2017 12:24 PM UTC

Hi BELADEL, 
 
We have validated the printing of report using “Microsoft Print To PDF” option both in Microsoft report viewer and Syncfusion ReportViewer, output of the printed PDF document is same as print layout. We suspect the problem is due to the different paper size in printer and report, please ensure the paper size of the report and paper size used in the printer is same. The printed document can be downloaded from the below location. 
 
 
Regards, 
Vinoth S. 


BELADEL ILYES ABDELRAZAK
Replied On August 4, 2017 01:07 PM UTC

I am using A4 format, and also chechek the printing settings in my application, and here my printing button:


            ReportWindow RW = new ReportWindow();

            string reportPath = System.IO.Path.Combine(new DirectoryInfo("reports").FullName, "9takrir-tarbawi16.rdl");

            RW.ReportViewerControl.ReportPath = reportPath;

            List<ReportParameter> parameters = new List<ReportParameter>();

            ReportParameter parameter = new ReportParameter();

            parameter.Name = "RP01";

            parameter.Labels = new List<string> { "ds" };

            parameter.Values = new List<string> { "5465464" };

            parameters.Add(parameter);

            RW.ReportViewerControl.SetParameters(parameters);

            RW.ReportViewerControl.RefreshReport();

            RW.Show();


BELADEL ILYES ABDELRAZAK
Replied On August 4, 2017 01:25 PM UTC

After setting the report to paper A4 format(previously I set custom height), now it prints as expected.


Vinoth Srinivasan [Syncfusion]
Replied On August 7, 2017 09:02 AM UTC

Hi BELADEL, 

Thanks for your update. Please let us know if you require any further assistance on this. 

Regards, 
Vinoth S. 


BELADEL ILYES ABDELRAZAK
Replied On August 9, 2017 06:28 AM UTC

I don't know what it changes now but it is surprisingly the report now printed in 03 pages instead of two.

Report width = 21.0058cm / Height = 29.6926cm

Body width = 20.5cm / Height = 58.5cm

From the code nothing is changed, and the report is set to A4 format.

So what is wrong I am doing here?


Attachment: 9takrirtarbawi16_5a64f9b3.zip

Vinoth Srinivasan [Syncfusion]
Replied On August 10, 2017 01:24 PM UTC

Hi BELADEL 
 
We have validated your shared report in both syncfusion report viewer and Microsoft report viewer. While printing the report using “Microsoft Print to PDF” option we are getting 4 pages in both Microsoft and Syncfusion viewer. Please find the printed PDF documents from the below location.  
 
 
But, you have mentioned that the report is printed with 3 pages. Could you please confirm whether you have shared the proper report with us and if you still face any issue then we request you to share snapshot or issue reproducing report with us. It will be helpful for us to validate the problem at our end. 
 
Regards, 
Vinoth S. 


BELADEL ILYES ABDELRAZAK
Replied On August 11, 2017 02:13 PM UTC

This is the updated the version with parameters I pass from code behind, still getting 04 pages printed.

From code I only pass parameters like this:


ReportWindow RW = new ReportWindow();

            string reportPath = System.IO.Path.Combine(new DirectoryInfo("reports").FullName, "9takrir-tarbawi16.rdl");

            RW.ReportViewerControl.ReportPath = reportPath;

            List<ReportParameter> parameters = new List<ReportParameter>();

            ReportParameter parameter = null;


            //string LightingStatus = Convert.ToBoolean(LightingStatusText.IsChecked) ? "نعم" : "لا";

            string wilaya = wilayaText.Text;

            parameter = new ReportParameter();

            parameter.Name = "wilaya";

            parameter.Labels = new List<string> { "wilaya" };

            parameter.Values = new List<string> { wilaya };

            parameters.Add(parameter);


            string baladia = baladiaText.Text;

            parameter = new ReportParameter();

            parameter.Name = "baladia";

            parameter.Labels = new List<string> { "baladia" };

            parameter.Values = new List<string> { baladia };

            parameters.Add(parameter);

            RW.ReportViewerControl.SetParameters(parameters);

            RW.ReportViewerControl.RefreshReport();

            RW.Show();


Attachment: 9takrirtarbawi16_7fbe12a5.zip

BELADEL ILYES ABDELRAZAK
Replied On August 14, 2017 12:36 AM UTC

I can summarize my issue in two cases:

01) If I run my report from the REPORT DESIGNER then it prints two pages as expected.

02) If I run the report from my application then it shows three pages instead of two.

In the attachment you will find a simple C# report application project to demonstrate my problem. Please don't just run the report from REPORT DESIGNER, try it also from the project I included to see the issue.


Attachment: SimpleReport_bddc5185.zip

Vijay Raja [Syncfusion]
Replied On August 14, 2017 01:02 PM UTC

Hi Beladel, 
Query 
Response 
01)If I run my report from the REPORT DESIGNER then it prints two pages as expected. 
 
 
02)If I run the report from my application then it shows three pages instead of two. 
We have tested the provided report in SSRS ReportViewer and our control both the output shows three pages, refer to the below attached snap for your reference. 
We suspect that in your application and report designer application assemblies are in different version due to this we got different page count, please share the assembly version details of report designer application and your application assemblies version with us it will be helpful for us to provide a solution at the earliest. 
Regards, 
Vijay R.

BELADEL ILYES ABDELRAZAK
Replied On August 14, 2017 08:42 PM UTC

Hello Mr Vijay,

First, did you checked my simple project that I included here http://www.syncfusion.com/downloads/support/forum/131890/ze/SimpleReport_bddc5185 ?

The assembly I am using is: 15.2.0.46

The Synfusion Report designer is: 15.2.0.46 

In the project I attached, two pages get printed in Report Designer and three if it's printed from my application.


Vijay Raja [Syncfusion]
Replied On August 15, 2017 03:37 PM UTC

Hi Beladel,

Sorry for the inconvenience causes.

A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents
 

Regards,
Vijay R.
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;