ASP.net: Crystal Reports - Subreport over multiple pages - asp.net

I have a Crystal Report that has a header and a subreport with the height locked at a exact amount so the subreport will display a maximum of 20 rows on the page.
However, this limitation has restricted the use of the system, and the users now require an unlimited number of rows in the subreport.
I wish to keep the same layout as the report currently is, however the first 20 rows of the subreport will be on Page1, the next 20 rows (21-40) will be on Page 2, and so on.
How would I modify the logic in the Crystal Report to allow this kind of functionality?
Thanks.

I don't have Crystal Reports handy, but off the top of my head you can try adding a formula to the subreport's detail New Page After, by doing something like this:
RecordNumber Mod 20 = 0
For every 20th record, the subreport should page break after the detail.

Related

How to generate mutiple pages with BIRT Report Designer

I would like to generate multiple page of a report. The number of pages would be defined in a variable from a Data Set.
example: if the variable is set to 5, the report would be generated in 5 copies (1/5, 2/5.. 5/5).
I'm using BIRT Report Designer 4.4.0.
The rest of the report is filled with other data that would stay the same in the n pages.
I managed to show the page number and the total number of pages (the variable) but didn't manage to generate that amount of pages.
I have no clue how to proceed, so until now, I only manage to generate 1 page.
You can use either a scripted data set or some SQL statement (for e.g. on Oracle something like this)
select rownum from user_objects where rownum <= :pi_num_copies
to create a "for-loop" data set.
I would try the following.
Insert (into the report) a Table binded to your Data Set with a
single column - your "NumberOfCopies" field.
Add Group for the NumberOfCopies.
Put your repeating n-times data to the Table Detail (you can replace the original field with it). Add fixed (for
every page) info to Group header and footer.
Set After property to Always in Page Break paramener
section for Group Footer (not for table's one!)
I guess it will work. If not - play around with Page Break options in Table Footer and Detail...

How do I set every page of a Stimulsoft to show ten rows?

How would I set number of records in every page of a Stimulsoft report?
I want every page of report to show 10 rows.
I've found the answer in the Stimulsoft forum. You can use the DataBand's BeforePrint event to conditionally force a new page by using:
if (Line % 10 == 0)
Engine.NewPage();

how to generate a pdf report from asp.net web page

I have a web page in my application, which has two pictures in the header, a table after this header with two rows and 2 columns (In this table I have textbox for entering item Id), then a gridview to display the records of particular item, and at the end I have another table after the "gridview" (In this table I have another textbox to display total no.of records).
If I enter just itemId, then it display all the records of that item in the gridview and total no.of records in the textbox.
I have to repeate this process for 170 items, kindly show me some solution to get all the items data just in a click, but for every item (the header and two tables must be repeated).., and if this output either I can save in pdf file or as word file..
Thanks in advance..
I recommend you to use JSPDF... Simple and ok: http://parall.ax/products/jspdf
What I have used in the past it is iTextSharp. I think it is one of the most powerful open source frameworks available to work with PDFs in general.
Here are some code sample on how to use it:
http://aspsnippets.com/demos/432/
http://www.codeproject.com/Articles/200079/All-in-One-Export-Data-in-ASP-NET

Efficient paging with Repeater, SQL Server and custom Pager

I have just uploaded the following article to codeproject:
http://www.codeproject.com/KB/webforms/efficientpagingrepeater.aspx
Basically it is using Repeater, SQL Server with the ROW_NUMBER() OVER statement and a custom pager.
I would like to extend the pager so that it can be used multiple times on a single page and also allow previous / next buttons. I am unsure how to do that - can anybody provide suggestions / some code modifications?
CP hasn't posted the article yet, so I cannot comment on that. I can say that just about every DAL tool (EF, NH, AR, Massive, Dapper.Net, Simple.Data) all have paging built in. so hooking up paging to a repeater should not be a problem at all.
If the article is referring to a webforms server control that pages data, I would avoid it at all costs. data access should not be managed by UI components. and using any of the various DAL listed above, it's very simple to access the database using code, instead of drag-n-drop controls.
to get db paging in place you need 3 inputs and 2 outputs
inputs
sql query & parameters
starting point (page or page index)
max # of records (page size)
outputs
current page of results
total number of records
using the total number of records and the page size you can calculate the total number of pages.
var pages = total records / page size + (total records % page size > 0 ? 1 : 0);
with the page of results, current page & total number of pages you can build the UI layout
I hope this resolves your question.

Grouping data in an RDLC

I'm sorry if this seems silly, but I'm new to using Report Definition Language (RDLC) files and I'm looking for advice on the best "plan of attack" for a report I must create.
THE REPORT
The report (itself) must display a table of data above a related set of calculations for each a grouping (of data). I'm hoping to keep one group per page...but that may not be possible as each table may become quite long (but that is another question for another day).
...There can be 1 to N GROUPS
Example
(GROUP 1)
TABLE
FORM CALCULATIONS
PAGE BREAK
(GROUP 2)
TABLE
FORM CALCULATIONS
...and so on.
IS THIS THE BEST WAY TO DO THIS?
Place each group into a SUBREPORT. The sub report would then contain the table & form calculations.
...is this right or is there a better way to do this?
THE ACTUAL ANSWER IS
The outer RDLC contains a LIST control which contained the following controls:
TABLE (containing items related to the collection as a whole)
SUBREPORT
The SUBREPORT points to an RDLC which contained the following controls:
TABLE (containing row items)
(1) Use the LIST's "grouping" property to group your 1-to-N collections. The "grouping" property is found by choosing the LIST control then choosing Visual Studio's menu options as such: VIEW > PROPERTIES WINDOW.
(2) Next, set the LIST's data source.
This is found using by choosing the REPORT and then choosing Visual Studio's menu options as such: REPORT > DATA SOURCES. Drag any field onto the control and the data source will automatically set itself up.
NOTE:
If you cannot "see" any data sources in Visual Studio's data sources window it is "probably" because service references in your project are causing issues...temporarily exclude them from your project and choose RESFRESH icon within Visual Studio's data sources window (they should then appear). Sadly, you must do this EVERY TIME your data source changes.
Once you have the LIST iterating properly you can add-in the SUBREPORT and any other controls.
...I now OFFICIALLY hate RDLC's.
personally if i had to do this report i will do it with two different tables. In one rdlc you can put two datatables one will display GROUP 1 Data the second one GROUP 2 Data. The Table has option Page break at end of datatable which can give the PAGE BREAK Between the two datatables.
Best Regards,
Iordan

Resources