Print Page | Close Window

Pull .rpt from database

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17000
Printed Date: 16 Apr 2025 at 9:02pm


Topic: Pull .rpt from database
Posted By: rushelp
Subject: Pull .rpt from database
Date Posted: 10 Jul 2012 at 6:48am
Is there anyway to save my crystal report files to database(SQL Server) and then pull it from database to show it in the crystal report viewer?



Replies:
Posted By: hilfy
Date Posted: 10 Jul 2012 at 7:16am
Not without saving it as a .rpt file and then loading it.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: rushelp
Date Posted: 10 Jul 2012 at 7:26am
Any examples by any chance? I couldn't find any.


Posted By: hilfy
Date Posted: 10 Jul 2012 at 8:39am

Assuming you're working in VisualStudio and not in Java, I would do something like the following:

1. Create a FileStream

2.  Stream the contents of the db field containing the report out to a .rpt file.
 
3.  Create a ReportDocument.
 
4.  Use ReportDocument.Load to load the file you just saved.
 
5.  Set the ReportSource of the viewer to the ReportDocument.
 
6.  View the report.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window