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

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

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...

Collect all parameters from all reports in reportserver folder and populate a sql table

[Thanks to Filburt and Devjosh. I have restructured the post and included my attempt approach. ]
I have a table on my SQL DB call ReportList which is a list of report. I need to go through that list and interrogate the reportserver, eport by report, to populate a table called ReportParameters. The ReportParameters table has a column for ReportOwnerID which needs to contains the ReportID value of the corresponding (owner) report as listed in the ReportList table.
This is in VB.NET 2005 ASP2.0 and I have ended up with a mess. Please help me with the cleanest approach to doing this.
It needs to work so:- I have a listbox of the reports as per REportList and a GridView that list all the parameters (uniquely - most of the parameters are common to many reports) the idea being that the parameters get set once and the report can be kicked off by selecting them in the ReportList CheckListBox and clicking on Execute.
I would like it that as I click on a particular report in the ListView, the relevant parameters in the Gridview get a green background and those that do not apply are red. The leftmost column in the gridview contains tha Parameter NAME (not editable) and the next column must be editable to populate the value.
DONE SO FAR:
I have tried on clicking the EXECUTE button , to build a parameters string in a testbox and call that with the Javascript OpenReportWin() function when I open the report in a new window. This works fine, but my biggest issue it interrogating the reportserver reports to get back a list of parameters and dooping them into a table. I have triend to use a hidden DataGrid bound to a ds onto the reportParamaters table; I have tried to poulate it using a datalist but I cannot get the hang of these thionsg and its looking messy. Ther must be a simple clean way of gettting the .GetParameters resultset back from the report server and populating the table without having to create a reportviewer object and cycling through the list of reports - it then has to render each report before you can get that list out.
Thanks
I will withdraw this for now. I will submit a solution when I am comfortable that I have reahced a clean solution.
Mac
PLEASE CLOSE!!!

How to hide one column in grid while exploring to excel

I showed data in gridview.There are lot of column,so used scroll bar to grid.For finding out perticular record,used auto generated select button.Suppose I select one record,it become different in colour.When I exporting data to excel,it shows that coloured column and select button also in excel .So I want to hide that select button and color of row of selected column.Even when I am taking diffrent record,that time also showes one row colored.I want liked this when I am selecting one item from dropdownlist,gridview should get disappered and on button clicked gridview should appered.Gridview has paging and column are auto-generated.
It seems that you are using GridView's RenderControl to export the data. This method writes the current html of GridView. If you want exported data to be formatted other than the GridView's current format then, I suggest that you to use HTML Table method to export the data.

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

How do I use the ASP.NET grid view to instert new records?

Using the ASP.NET grid view. It displays 3 columns with 1 row for each, displaying an integer saved in the database. I would like to have a text input one for each column, so the user can add a new row of integers to the database. (The table only displays the last row updated, that part seems to be working OK)
Here is the code I have that displays data but without the input option I would like.
What is the way this is done in ASP.NET (3.5)? Are there more options in the control or do I need to manually bring in text input controls and give each one manual code to update the database? Any help is appreciated.
Thank You.
Do you know the asp.net website? There are a lot of tutorials, e.g. about data access. You might find the information you need, e.g An Overview of Inserting, Updating, and Deleting Data.
Also check out the ASP.NET Dynamic Data section on the same page.

Resources