2012-10-19 90 views
0

我有一個應用程序經典Asp,我需要使用SQL Server Reporting Services。生成報告的頁面有一些過濾器,我必須使用它。SQL服務器與經典ASP的報告服務

我已經制作了存儲過程和SSRS解決方案。我只想知道如何在經典ASP中調用報告。

謝謝。

+0

在ASP.NET我把這樣的報告:ScriptManager.RegisterClientScriptBlock(此.Page,this.GetType(),「t」,「abrirRelatorio('」+ ConfigurationManager.AppSettings [「ReportServer」]。ToString()+「rel_ficha&fic_codigo =」+ objStr.ToString()+「&rs%3aCommand = Render&rs: ClearSession = true&rs%3aFormat = pdf&rc%3aToolbar = False&rc%3aJavaScript = False&rc%3aLinkTarget = _top&rc%3aArea = Params');「,true); –

+0

你有沒有在你的頁面中有一個叫做'abrirRelatorio'的函數?我想你將不得不添加一個腳本塊到頁面來添加該功能。報告服務器的值可以從web.config獲得,其餘的值可以這樣使用..你必須將這個函數綁定到按鈕或鏈接的onclick上。你是如何做到這一點的.net? – SearchAndResQ

回答

1

經過一番研究,我找到了我的解決方案。 我在輸入按鈕中使用了onClick事件,調用一個函數。 參見下文代碼:

「 功能報告(){

 var vexp_expediente = document.getElementById('txtexp_num_exp').value; 
     var vpro_obs = document.getElementById('txtpro_obs').value; 
     var vsit_id = document.getElementById('sit_id').value; 
     var vpro_numero = document.getElementById('txtpro_numero').value; 
     var vexp_requisitante = document.getElementById('txtexp_requisitante').value; 
     var vexp_num_req = document.getElementById('txtexp_num_req').value; 
     var vlic_id = document.getElementById('lic_id').value; 
     var vare_id = document.getElementById('cboare_id').value; 

     window.open("http://Report-Server/ReportServer?%2fSCPC%2fRel_Processos_Compra&exp_num_exp=" + vexp_expediente + "&pro_obs=" + vpro_obs + "&sit_id=" + vsit_id + "&pro_numero=" + vpro_numero + "&exp_requisitante=" + vexp_requisitante + "&exp_num_req=" + vexp_num_req + "&lic_id=" + vlic_id + "&are_id=" + vare_id + "&rs%3aCommand=Render&rs:ClearSession=true&rs%3aFormat=excel&rc%3aToolbar=False&rc%3aJavaScript=False&rc%3aLinkTarget=_top&rc%3aArea=Params"); 
    } 

</script>" 

謝謝大家誰試圖幫助

+0

幾年後有用。謝謝! – Dragick