2012-03-13 75 views
1

嗨,我是在用C#中asp.net應用程序水晶報表的工作,我的問題是 ,生成的報告應該有與下面的代碼生成的QR碼加載圖像報告

  QRCode qrcode = new QRCode(); 
      qrcode.Data = "Id Asociacion Civil:" + query.fiIdAsocCivil + "\n" + "Fecha de Registro:" + query.fdFechaReg.ToShortDateString() + "\n" + "Nombre de la Asociación:" + query.fcRazonSocial; 
      qrcode.X = 12; 

      // Create QR-Code and encode barcode to Jpeg format 
      qrcode.ImageFormat = ImageFormat.Jpeg; 
      if (Request.ApplicationPath == "/") 
      { 
       qrcode.drawBarcode(@"\\cjfapppba\ssac\Ejemplo1.jpg"); 
      } 
      else 
      { 
       qrcode.drawBarcode((MapPath(@"~/Ejemplo1.jpg"))); 
      } 

     } 
     catch (Exception x) 
     { 

      Label1.Text = x.Message; 
      Label1.Visible = true; 
     } 

每當我點擊「報告」按鈕創建報告時,代碼就會被執行並覆蓋最後的qrcode。我的問題是,如果我掃描二維碼,它ios更新正確,但在我的報告中沒有。我試圖添加一個OLE對象作爲其他論壇的建議,但沒有成功。 有關如何實現此目的的任何建議?

我打電話報告這個代碼

GeneraCodigo(); 

     switch (e.CommandName) 
     { 

      case "Registro": 



        var strRep = new StringBuilder(); 
        strRep.Append("<script languaje=javascript>window.open('http://portalrpt/reportes/default.aspx?rep=SSAC/Constancia.rpt&mod=136&sf={AsocCivil.fiIdAsocCivil}="); 

        strRep.Append(idAC); 



        strRep.Append("','','width=670,height=570,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes');</script>"); 

        ClientScript.RegisterStartupScript(Page.GetType(), "WOpen", strRep.ToString()); 

和方法GeneraCodigo()可以生成新的QR碼

回答