Hi,
I have report with parameters that I am filling through code.
I have turned off the reports RequestParameters feature i.e. rep.RequestParameters = false;
but when I load the report into the print preview window, the parameters panel is showing on the left. I want to be able to hide this permanently.
How do I do this?
Regards
Mike
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Mike,
Actually, it should be enough to set the XtraReport.RequestParameters property to false to hide the parameters panel.
However, you can also set the Visible property for each of the parameters to false.
If it does not help, please provide us with a sample, illustrating your issue.
We will examine it and do our best to help you.
Thanks,
Andrew
Hi,
That didn't work. I have attached a screen shot of what I am seeing.
This is the code I am using :-
rep.RequestParameters = false;
rep.Parameters["Supplier"].Value = entry;
rep.Parameters["Supplier"].Visible = false;
rep.Parameters["AccountHandlerCopy"].Value = false;
rep.Parameters["AccountHandlerCopy"].Visible = false;
I am using my own print preview form. Is there a setting in there that I can use to hide the panel?
Regards
Mike
Mike,
Thank you for the feedback.
Could you please provide us with a sample, illustrating the issue?
We will examine it and do our best to help you fix the problem.
Thanks,
Andrew
Sorry for the delay.
OK, I have attached a test app which demonstrates 2 problems.
What am I doing wrong?
Regards
Hi Mike,
Thank you for posting your example. I see the problem. Actually, it is not quite correct to use an empty XtraReport document as a container for document pages generated by other report(s). Please check the updated Form1_Load event source code:
private void Form1_Load(object sender, EventArgs e) { // create some test data. Test ds = new Test(); Test.TESTDataTable tbl = ds.TEST; Test.TESTRow row = tbl.NewTESTRow(); row.BeginEdit(); row.SUPPLIER = "SUPPLIER 1"; row.EndEdit(); tbl.AddTESTRow(row); row = tbl.NewTESTRow(); row.BeginEdit(); row.SUPPLIER = "SUPPLIER 2"; row.EndEdit(); tbl.AddTESTRow(row); PrintingSystem mergedPS = new PrintingSystem(); printControl1.PrintingSystem = mergedPS; using (XtraReport1 r1 = new XtraReport1()) { r1.DataSource = ds; r1.RequestParameters = false; r1.Parameters["Supplier"].Value = "SUPPLIER 1"; r1.CreateDocument(); mergedPS.Pages.AddRange(r1.Pages); } using (XtraReport1 r1 = new XtraReport1()) { r1.DataSource = ds; r1.RequestParameters = false; r1.Parameters["Supplier"].Value = "SUPPLIER 2"; r1.CreateDocument(); mergedPS.Pages.AddRange(r1.Pages); } }
Thanks,
Alex
Hi Alex,
That code helped me understand what I was doing wrong.
Also, the original problem I had was because I was disposing the report after adding it's pages to the original report.
This seemed to cause the original parameter problem.
Hi Alex,
I have only just noticed that if I load a layout into the reports, it doesn't appear in the document.
I understand that this is because the layout isn't loaded in the mergedPS object i.e. only the reports pages are added, but there doesn't appear to be a LoadLayout method for the mergedPS (PrintingSystem) object.
Is there anyway to get the layout loaded so that it displays correctly?
Regards
This is aimed at your sample above.
Hi Mike,
If you need to save the merged document to a file (for the future use), please use the PrintingSystem.SaveDocument method for this purpose.
See: XtraReports > Examples > How to: Save and Restore a Report Document from a File.
Thanks,
Alex
OK, tracked the problem down some more.
The layout does load into the reports that get put onto the mergedPS object.
i.e.
r1.LoadLayout("file");
but, the layout has a watermark on it (it is an invoice layout so it shows an invoice in the background).
is there any reason why it doesn't load the watermark?
Regards
To clarify,
the layout loads correctly i.e. if I move textboxes around they show on the preview correctly, but the water mark background doesn't show up.
Regards
Hi Mike,
Thank you for the update. You might need to assign the Watermark to the required page(s) manually. Please review the following thread for a solution: Watermark in merge report.
Let me know if you need further assistance here.
Thanks,
Alex
Hi Alex,
Thanks for your help.
I simply recorded what the watermark was in one of the reps and then applied it to all the pages in the mergedPS one.
Regards
Well, none of those answers worked for me. For those you are looking for another alnernative, this code might be useful:
Dim pt As ReportPrintTool Dim ps As PrintingSystemBase 'Initialize print tool pt = New ReportPrintTool(reportObject) ps = pt.PrintingSystem 'Hide Parameters Panel before preview ps.SetCommandVisibility(PrintingSystemCommand.Parameters, CommandVisibility.None) ps.SetCommandVisibility(PrintingSystemCommand.SubmitParameters, CommandVisibility.None) pt.ShowPreviewDialog()
NOTE THAT ps.SetCommandVisibility method is the secret. Remember to set:
xtraReport.RequestParameters = False
And set each parameter by code using the following property:
xtraReport.Parameters.Item("PARAMETER_NAME").Value = PARAMETER_VALUE
Regards, my firiends.
Oscar,
Brilliant solution.
Thanks for sharing,
Randy