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