113 lines
3.5 KiB
C#
113 lines
3.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using Microsoft.Reporting.WebForms;
|
|
using System.Data;
|
|
using SteamWare;
|
|
using CMS_SC_Data;
|
|
|
|
namespace CMS_SC.WebUserControls
|
|
{
|
|
public partial class mod_reportCompleto : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// Tipo di report richiesto (da URL): Full / Cli / Short
|
|
/// </summary>
|
|
public string TipoReport { get; set; }
|
|
/// <summary>
|
|
/// Fase x report richiesto
|
|
/// </summary>
|
|
public string Fase { get; set; }
|
|
/// <summary>
|
|
/// Lingua x report richiesto
|
|
/// </summary>
|
|
public string Lingua { get; set; }
|
|
/// <summary>
|
|
/// dossier di cui creare report
|
|
/// </summary>
|
|
protected int IdxDossier
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.QSI("IdxDossier");
|
|
}
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
// collego il report...
|
|
fixReport();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// sistema dati x report
|
|
/// </summary>
|
|
public void fixReport()
|
|
{
|
|
ReportCMS.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
|
|
LocalReport localReport = ReportCMS.LocalReport;
|
|
localReport.EnableExternalImages = true;
|
|
|
|
// se HO un dossier e ho un tipo report...
|
|
if (TipoReport != "" && IdxDossier > 0)
|
|
{
|
|
|
|
// 1) impostazione file report
|
|
localReport.ReportPath = string.Format(@".\Reports\Report_{0}.rdlc", TipoReport);
|
|
|
|
// 2) caricamento tab dati
|
|
DataTable tabDati = new DataTable();
|
|
DataTable tabVoc = new DataTable();
|
|
tabDati = (DataTable)DtProxy.man.taRep.GetData(IdxDossier, Fase);
|
|
tabVoc = (DataTable)DtProxy.man.taVoc.getByLinguaLemmaLike(Lingua,"SC_PRT");
|
|
|
|
// 3) inserimento dataset nel report
|
|
localReport.DataSources.Clear();
|
|
localReport.DataSources.Add(new ReportDataSource("dsSchedaCollaudo", tabDati));
|
|
localReport.DataSources.Add(new ReportDataSource("dsVocabolario", tabVoc));
|
|
|
|
#if false
|
|
// 4) aggiungo parametro
|
|
ReportParameter filtroPag;
|
|
if (userIsMedicoRef)
|
|
{
|
|
filtroPag = new ReportParameter("PrintPage", "0");
|
|
}
|
|
else
|
|
{
|
|
filtroPag = new ReportParameter("PrintPage", "1");
|
|
}
|
|
localReport.SetParameters(filtroPag);
|
|
#endif
|
|
showReport(true);
|
|
}
|
|
else
|
|
{
|
|
// indico che mancano dati...
|
|
showReport(false);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// wrapper traduzione
|
|
/// </summary>
|
|
/// <param name="lemma"></param>
|
|
/// <returns></returns>
|
|
public string traduci(string lemma)
|
|
{
|
|
return user_std.UtSn.Traduci(lemma);
|
|
}
|
|
/// <summary>
|
|
/// sistema visibilità report
|
|
/// </summary>
|
|
/// <param name="showRep"></param>
|
|
private void showReport(bool showRep)
|
|
{
|
|
ReportCMS.Visible = showRep;
|
|
lblOut.Visible = !showRep;
|
|
}
|
|
}
|
|
} |