2011-12-08 6 views
0

こんにちは、私はウェブアプリケーションのCrystalレポートを初めて使いました。クリスタルレポートを開くためのパラメータを追加

private void AbreVisorReportesDict(int iIdRatificacion) 
    { 
     Response.Write(
      "<script type='text/javascript'>detailedresults=window.open('http://portalrpt/reportes/default.aspx?rep=SIDRJF/Dictamen.rpt&mod=116');</script>"); 
    } 

しかし、私はレポートをその場で対応するように、URLにiIdRatificacionを渡す方法がわからない:私はこのように私のWebアプリケーションからCrystalレポートを呼んでいます。

お願いします。

答えて

0

参照の後ろにコード内でレポートビューアコントロールのプロパティを設定するためのより良い方法をtheresの:その記事から http://csharpdotnetfreak.blogspot.com/2009/07/creating-crystal-reports-in-aspnet.html

例:

 
protected void Page_Load(object sender, EventArgs e) 
    { 
     ReportDocument crystalReport = new ReportDocument(); 
     crystalReport.Load(Server.MapPath("CrystalReport.rpt")); 
     crystalReport.SetDatabaseLogon 
      ("amit", "password", @"AMIT\SQLEXPRESS", "TestDB"); 
     CrystalReportViewer1.ReportSource = crystalReport; 
    } 

あなたがそれを行うにはしたくない場合そのようにして、自分のクエリ文字列からパラメータを読み込んで新しい文字列を作成するだけでよいでしょう。

 
string mod = Request.QueryString["mod"] 

それはあなたの出力にあります。

関連する問題