Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2003, 12:11 PM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamically exporting the report to HTML

Hi there..
I am generating reports and have some problem while dynamically selecting the report source while exporting it to HTML. my application goes like this and i have explained the problem at the end. I would greatly appreciate if anyone can help me out...

1. in the application, users will select the report from the combo box
2. based on the value, appropriate dataset will be generated and that will be binded to the report source of the crystal report viewer
3. the export button should export the report thats in the report source..i wrote a code to export to html and that also works fine
4. the problem is while exporting i should be able to get dynamically the binded source of the viewer control and pass it to a generic ExportToHtml method.

code explanation:

report declarations at the start of the code
crSales_Report mcrSales_Report;
crMark_Report mcrMark_Report;

on button click event i am calling this method based on the type of report that he selected initially
ExportToHTML(mcrSales_Report, folderName, fileName);
ExportToHTML (mcrMark_Report, folderName, fileName);

method declaration:
ExportToHTML (crSales_Report myReport, string folderName, string fileName)
{
//basic code for html format option and destination options
 myReport.Export()
}

the problem is in the method declarataion, right now i am hard coding it as crSales_Report class, but that should be dynamic...

i have also tried this

crystalreportviewer.ReportSource.GetType() - it returns the value of the class (crSales_Report), but i donno how to use this....can anyone help me out??

Thx--sara







Similar Threads
Thread Thread Starter Forum Replies Last Post
how to dynamically change an HTML page kpnikhil PHP How-To 1 September 7th, 2007 03:53 AM
Error while exporting to html spacy Crystal Reports 1 September 10th, 2006 06:15 AM
Exporting to HTML Tachyophan Access 0 August 14th, 2006 02:30 AM
Creating HTML tables dynamically dotnet cat ASP.NET 1.0 and 1.1 Basics 1 August 25th, 2005 10:58 PM
Generating html tags dynamically sachin lad Servlets 1 April 26th, 2005 05:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.