Using Crystal Reports and .NET I have a requeriment where I need to print 2 copies of the same report on each sheet. I´m able to do this using two subreports setting CanGrow to false, but this doesnt work cause my report may have more than one page, and CanGrow will just crop the rest of the report. Setting CanGrow to false will cause the two reports to overlap, or print one after another. I also tried making a double report, Header - details - footer, and Header - details - footer again (repeating the same information), but crystal reports doesnt allow me to have multiple details sections(with header footer sections between them).
I´m able to reproduce what I want using MsWord, in the printing settings changing the printer setting "print multiple copies" to 2, and then typing and setting Page range to "Page: 1,1,2,2,3,3,4,4... " but the printing API from Crystal Reports won´t let me adjust these settings, not even printing APIs from .NET, so I though of using Native Win32 API, but even if I´m able to do this with Win32 I don´t know how to tell Crystal Reports to use my printing functions.
I´m pretty new to crystal reports so maybe there is a simple solution for this. If someone can help.
I think you'll need to keep your subreport the way you have it, with the report details you want copied, but you can't place the two instances of the subreport in the same section and expect them to space themselves correctly. You'll need to use a second detail section in your main report for your second subreport, then they shouldn't overwrite each other. The detail sections both need cangrow = true set.
OK, all you should need is 2 reports, one formatted the way the customer wants (headers, footers, etc.) to use as the subreport, and one without any headers or footers, but 2 detail sections with cangrow=true and an instance of the subreport in each detail section. I'm not sure why you want a new page after 5 records, but try taking that out and see if you can print the same subreport twice within a main report.
I think I kind of solved it. I created two reports: Orignal, and Copy, and supressed all sections except details section and added a group using the workaround mentioned here:
http://www.c-sharpcorner.com/UploadFile/mahesh/SubReportPH10062006160749PM/SubReportPH.aspx
to be able to use headers that would repeat on every page.
I put all my header information on the group header, and the report footer information on the group footer(other sections can´t be used since they wont respect the spacing I need, that´s the major drawback of this workaround), and limit the details section to a number of records that will fill only half of the page. In the copy version I added a space in the header equal to half of the page. Then I created the report that will hold both subreports with all sections supressed and only one detail section, and added both subreports there one on top of another. This will print the second subreport at the bottom of the page leaving the space from its header for the first subreport to print on top, I still don´t know how to repeat footing section on every page by now but I think I don´t need it.
Related
I work on an MVC application that generates reports from rdlc files. Particularly, i have a WS that generates a PDF document with one or more DataSources with a single page rdlc file.
Now my problem is : the customer wants to add a page between each page, only if a certain condition is satisfied. I can modify my rdlc file to add this document, but i can't get it to show only certain times...
I've tried playing with visibility, page breaks but it doesn't work. I've even thought about generating each page independently and merging it in one PDF file.
What would be a clean way to do it ?
If you have all your page-breaking set correctly, which you claim you did, you could wrap the extra page inside a Rectangle where you define an expression for the hidden property.
When this rectangle becomes hidden the entire page shouldn't be rendered.
If you need help with defining the expression you'll have to share a lot more information but this shouldn't really be a problem to achieve by yourself.
I am having s group box of Radio buttons. having options like
1.) Page 1 & 2
2.) Page 3 to 6
3.) Page 7
4.) All
and on the basis of this selection I want to show my Report in the reportviewer. I am trying to search stuff on it, but didn't found any thing. My report is having one main report with seven sub-reports. Any idea or code snippet will be helpful.
Thank you
I'd suggest either one of two options:
Generate four different reports (ie. .rdlc files), one of each one of your options, including the corresponding sub-reports.
Have a single report and pass the option as a parameter through SetParameters and then dynamically exclude reports based by checking the option within your report.
I'd personally go with the first one since it will allow you more flexibility. Since each one of your sub-reports also goes in a different .rdlc, their maintenance shouldn't be a hassle and duplicity should be minor.
I have a C# 2010 application that contains a report created using Crystal Reports for VS2010. Its purpose is printing an invoice for a client. I need to add a page (same for each invoice) that shows the methods by which the client can pay the invoice.
This would basically require me to add a page that is different from the rest of the report, at the end of the report. How can I do this?
Thank you.
I can't remember 100% if the Crystal for VS2010 supports it but Crystal Reports does have the option for defining a report footer section. If you activate this section and configure page break before to be on this should have the effect you desire.
Addition by Vlad Schnakovszki:
To prevent the Page Header section from appearing on the last page, do this:
Right-click on the Footer Section, choose Format Section. Click the button beside the Suppress (No Drill-Down) under Common Tab and place this code.
if pagenumber=TotalPageCount then true
else false
Bob Vale - Alternatively just put the formula as pagenumber=TotalPageCount
Source here.
We are using Crystal Reports XI R3 for our reporting purposes. We have created typed dataset which act as the datasource for the reports.
I am facing an issue including a bar chart along with the grid on one of the reports. The chart gets embedded into the header section by default and the grid is generated out of the details section.
If I design the report without the chart, it all works fine. If I supply 8 rows of data, it publishes 8 rows in the report too. But if I include a chart on the same report, the data in the details section gets multiplied, and I get 64 rows or something with the same datasource.
This should be a pretty straight forward functionality, but it doesn't seem to be working for me. I tried include a sub-report and have the details section in the sub-report and it works fine. But, I can't go with this approach either as this report in itself would be included to another as a sub-report and we cant have nested sub-reports in Crystal.
Please help me with some pointers on what could be going wrong ?
Edit: On further investigation, it looks like a problem with having two different tables to populate the chart and the grid. If I use a single table for both, it works fine.
Attaching screenshot on #Kalyan's request:
The issue indeed was with using multiple unrelated tables for a single report. Crystal Reports by default doesn't allow using multiple tables, unless they are linked in someway. If you dont specify a link, it tries to apply a link on its own and runs a join while publishing the report.
Due to this join, the data was getting repeated for me.
To resolve the issue, I created a group on the primary key of the table corresponding to the grid, and used the group to generate the grid and suppressed the details section. Problem resolved.
I am using Crystal Reports with C# programming language.
I want to open another report by clicking on link eg. I show Invoice's Summary like its number (named InvNo), date, items and TotalAmount.
Now I would like to open another report when user clicks on InvNo column. If user clicks on Invno 0001 then another report should be opened showing Item-wise details...
Is there any solution for this?
There are two 'linking' options:
use an 'on-demand' subreport - this is a report embedded in another report. it is NOT generated until its link is clicked. 'standard' subreports are generated at the same time as the 'main' report. in either case, a subreport can NOT contain another subreport.
create a hyperlink to another report by setting a field's Hyperlink property (choose the 'A Website on the Internet' option). if you create a conditional formula (the 'X+2' button), you'll have more control over the URL that is generated. you'll probably want to create a controller page (like 'view_report.aspx') that parses the querystring for the report's id (id=234), opens the report, authenticates, add parameters (country=USA®ion=MN&start_date=20110501), generates the report, then returns it.
Use option 1 for the summary, then use option 2 for the item's details.
If you are using BusinessObjects Enterprise, use UrlReporting for option 2.
I believe subreports functionality is an answer to your question.
You would need to enter a formula that conditionally shows/hide them (they should be hidden by default). Unfortunately I cannot tell you how to do that from the back of my head, since I haven't worked on CR for pretty long time now... Please find few links here.