Visual Basic .NET Forums  

Go Back   Visual Basic .NET Forums > Announcements > Vendor Announcements

Vendor Announcements News and Information from Vendors - New Product Releases, New Versions, ...(moderated)

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-09-2008, 9:49 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2008
Age: 26
Posts: 1
Reputation: 0
cnirmal is on a distinguished programming path ahead
Default Stimulsoft Reporting Cross tab and Export to PDF

Stimulsoft Reporting Cross tab and Export to PDF

Stimulsoft reporting provides a set of powerful reporting tools Microsoft Visual Studio .net 2005 and 2008; these tools are available for windows forms as well as web forms. They provide many useful features such as an easy to use report designer and native support for exporting to pdf, word, excel and various other formats. Crystal report and Microsoft reports are great for day to day reporting, but if you need to create reports with cross-tabs and drill down, ajax, support for bar codes and connecting to more than one report source at the same time, then stimulsoft reporting is a very good solution. They also have a feature where end users can create their own reports for adhoc reporting. All these features make stimulsoft reports a good choice for business intelligence reporting.
In this tutorial I will show to create a simple cross tab report, show it on a web page and allow users to export the report to word, excel and pdf without writing a single line of code.
The data for this sample report will come from the AdventureWork sample database provided by Microsoft.
The demo version of Stimulsoft reporting tools can be downloaded from their website Downloads - Reporting Tool for .Net Framework, Runtime Royalty Free Report Designer, Web Reports for Asp.Net .
The following steps are required in order to create a cross tab and export it to pdf, word, excel and other formats

1.Add report to your web page.
2.Add a new connection to the report.
3.Add a Data Source to the report.
4.Add a Cross-Tab to the report.
5.Load the Report from file.
6.Export the report to pdf.


Add report to your web page

·Drag and Drop StiWebReport from the toolbox to your webpage
·Click on the arrow on the top right corner of StiWebReport1 to show StiWebReport Tasks
·Click on Design Report to open the report Desinger

Add a new connection to the report

·Find the Dictionary on the right side of the report designer
·Click on the New Item Icon and select New Connection
·Select Sql Connection and click OK
·Type the connection string for the AdventureWorks database
·Click test to confirm that the connection string is correct.


Add a Data Source to the report

·Click on the New Item icon the Dictionary pane and select New Data Source
·Select Data from Sql Connection and Click Ok
·Type the name of the query in the Name field as Sales
·Type the SQL query in the Query Text Field
·Click on Retrieve Columns to confirm that you have all the required columns
·Click Ok to see the Sales Datasource in the Dictionary Pane
·The following query has been used in the report
SELECT [SalesOrderID]
,[RevisionNumber]
,[OrderDate]
,[DueDate]
,[ShipDate]
,[Status]
,[OnlineOrderFlag]
,[SalesOrderNumber]
,[PurchaseOrderNumber]
,[AccountNumber]
,[CustomerID]
,[ContactID]
,[SalesPersonID]
,st.Name
,[BillToAddressID]
,[ShipToAddressID]
,[ShipMethodID]
,[CreditCardID]
,[CreditCardApprovalCode]
,[CurrencyRateID]
,[SubTotal]
,[TaxAmt]
,[Freight]
,[TotalDue]
,[Comment]
FROM [AdventureWorks].[Sales].[SalesOrderHeader] soh
Inner join [AdventureWorks].[Sales].[SalesTerritory] st on soh.TerritoryID = st.TerritoryID


Add a Cross-Tab to the report

·Click on Cross Bands icon on the right toolbar and select Cross-Tab
·Draw the cross tab onto the report
·The Cross-Tab Designer window will appear
·Select Sales in the Datasource dropdown
·Add OrderDate in the Columns list and change the display value property and value property to {Format("{0:yyyy}", Sales.OrderDate)} in order to show only the order year.
·Add Name to the Rows list and TotalDue in the Summary Field
·Click OK to save the changes.
·Press F5 to preview the report.
·This report now shows the total amounts due by sales territory and year, it also gives a total of each row and column.
·Save the report as Sales.mrt and close the report designer.




Load the Report from file

Click on the right arrow on the StiWebReport1 object on the aspx page and select Open report from file
Browse to the location where you saved the report as an .mrt file.
Show report in the report viewer
Drag and Drop a StiwebViewer object to the page where Stiwebreport1 object already exists.
Add the following code to the page load event of the page.
protected void Page_Load(object sender, EventArgs
{
if (StiWebViewer1.IsImageRequest) return;

if (!Page.IsPostBack)
{
Stimulsoft.Report.StiReport oRep = StiWebReport1.GetReport();
StiWebViewer1.Report = oRep;
}
}
The first line is required as part of the stireports framework.
The second if statement is used to load the report only once when the page load occurs and the 2 lines in the if statement set the report source of the report viewer.
Press F5 to view the report as a web report.


Export the report to pdf

Click on the save and select Abobe Pdf.
Users can export the report to a wide variety of formats shown below
No coding or external library is required to export.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 8:00 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0


For advertising opportunities click here.