Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Changing Crystal Report ReportSource dynamically via asp.net

Reply
Thread Tools

Re: Changing Crystal Report ReportSource dynamically via asp.net

 
 
kota
Guest
Posts: n/a
 
      06-24-2003
Use viewer.reportsource="complee phical path" like "D:/test.rpt"

I hope this may help you.

Kota.



mrwoopey wrote:
> One more thing I forgot to add. The user will select from a list of
> reports and this report location should be passed to the crystal
> reports viewer (in a web browser) to display.
>
> So, I need to be able to pass this report location to the crystal
> report viewer's "reportsource," to display the report. Like I said
> before, I can set the report source at design time but not runtime.
>
> Thanks,
>
> Phin
>
> (mrwoopey) wrote in message
> news:<. com
>> Hi,
>>
>> At design time I can point my crystal report object to a
>> ReportSource
>> (a .rpt file) via asp.net. I need to change the ReportSource
>> dynamically, so when a user wants to view a report, I'll
>> pass the .rpt
>> file location to the aspx page that has the crytal
>> reports viewer and
>> it should display the requested report.
>>

> etc..


--
Posted via http://web2news.com the faster web2news on the web
 
Reply With Quote
 
 
 
 
Huzaifa Matawala
Guest
Posts: n/a
 
      06-27-2003
hi mrwoopey

check the below i think this is what u r looking for
public ReportDocument oRpt=new ReportDocument();

// write a if condition to check the selection

string str=Server.MapPath(report Name);
string str1=str.Replace("\\", \\\\);
oRpt.Load(str1);

//you have to pass the logon parameters for the report
CrystalDecisions.Shared.TableLogOnInfo crLogonInfo;
crLogonInfo = oRpt.Database.Tables[0].LogOnInfo;
crLogonInfo.ConnectionInfo.ServerName = Session["Server"].ToString().Trim();
crLogonInfo.ConnectionInfo.UserID =Session["dbUser"].ToString().Trim();
crLogonInfo.ConnectionInfo.Password =Session["dbPwd"].ToString();
crLogonInfo.ConnectionInfo.DatabaseName
=Session["dbName"].ToString().Trim();
oRpt.Database.Tables[0].ApplyLogOnInfo(crLogonInfo);

CrystalReportViewer1.DataBind();

CrystalReportViewer1.ReportSource = oRpt;


huzaifa

"mrwoopey" <> wrote in message
news: om...
> Thank you for the reply but I am not sure if you understand want I am
> trying to do.
>
> The following link explains how to set the ReportSource at design time
> for Crystal Reports in asp.net/vb.net:
>
> http://www.aspfree.com/authors/jitaj...talreport.aspx
>
> I can do what the articale explains, setting a reportsource at design
> time.
> I need to set reportsource dynamically (at runtime).
>
> Here is the webform that has the reportsource with the following code:
>
> 'start of code
> <%@ Register TagPrefix="cr" Namespace="CrystalDecisions.Web"
> Assembly="CrystalDecisions.Web, Version=9.1.3300.0, Culture=neutral,
> PublicKeyToken=692fbea5521e1304" %>
> <%@ Page Language="vb" AutoEventWireup="false"
> Codebehind="WebForm1.aspx.vb" Inherits="WebReport.WebForm1"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
> <HEAD>
> <title>WebForm1</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
> <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> </HEAD>
> <body MS_POSITIONING="GridLayout">
> <form id="Form1" method="post" runat="server">
> <CR:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX:
> 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"
> Width="1030px" Height="1089px" ReportSource='<%# "C:\Program
> Files\Microsoft Visual Studio .NET\Crystal
> Reports\Samples\Reports\General
> Business\041603080548CPTAnalysisDrillDownDOE.rpt" %>'
> DisplayGroupTree="False" BestFitPage="False">
> </CR:CrystalReportViewer>
> </form>
> </body>
> </HTML>
> 'end of code
>
> I can't pass a report location to the reportsource to this page at
> runtime. If you have done this or know how to do this please let me
> know.
>
> Thanks!
>
> Phin
>
> "kota" <> wrote in message

news:<>...
> > Use viewer.reportsource="complee phical path" like "D:/test.rpt"
> >
> > I hope this may help you.
> >
> > Kota.
> >
> >
> >
> > mrwoopey wrote:
> > > One more thing I forgot to add. The user will select from a list of
> > > reports and this report location should be passed to the crystal
> > > reports viewer (in a web browser) to display.
> > >
> > > So, I need to be able to pass this report location to the crystal
> > > report viewer's "reportsource," to display the report. Like I said
> > > before, I can set the report source at design time but not runtime.
> > >
> > > Thanks,
> > >
> > > Phin
> > >
> > > (mrwoopey) wrote in message
> > > news:<. com
> > >> Hi,
> > >>
> > >> At design time I can point my crystal report object to a
> > >> ReportSource
> > >> (a .rpt file) via asp.net. I need to change the ReportSource
> > >> dynamically, so when a user wants to view a report, I'll
> > >> pass the .rpt
> > >> file location to the aspx page that has the crytal
> > >> reports viewer and
> > >> it should display the requested report.
> > >>
> > > etc..





 
Reply With Quote
 
 
 
 
mrwoopey
Guest
Posts: n/a
 
      07-01-2003
Huzaifa,

I'll try your solution also! Thanks!

Phin
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing Crystal report table at run time rakesh201180 Software 1 10-22-2008 09:58 AM
Generate Crystal report Dynamically =?Utf-8?B?QmFkaXM=?= ASP .Net 0 10-13-2006 06:44 AM
How dynamically generate a crystal report in ASP.NET web form? =?Utf-8?B?ZGF2aWQ=?= ASP .Net 0 06-23-2005 06:41 PM
Re: Changing Crystal Report ReportSource dynamically via asp.net Yifei ASP .Net 0 07-29-2003 11:47 PM
Re: Changing Crystal Report ReportSource dynamically via asp.net Alexander ASP .Net 2 07-03-2003 09:40 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57