84 lines
2.5 KiB
C#
84 lines
2.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 ScheMe_Data;
|
|
|
|
namespace ScheMe.WebUserControls
|
|
{
|
|
public partial class mod_reportVisita : System.Web.UI.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
// collego il report...
|
|
fixReport();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// sistema dati x report
|
|
/// </summary>
|
|
public void fixReport()
|
|
{
|
|
RepVisita.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
|
|
LocalReport localReport = RepVisita.LocalReport;
|
|
localReport.EnableExternalImages = true;
|
|
|
|
// 0) recupero la richiesta di data...
|
|
DateTime DataVisita = DateTime.Now;
|
|
try
|
|
{
|
|
DataVisita = Convert.ToDateTime(Request.QueryString["DataVisita"]);
|
|
}
|
|
catch
|
|
{ }
|
|
|
|
// 1) impostazione file report
|
|
localReport.ReportPath = string.Format(@"{0}\ReportVisita.rdlc", memLayer.ML.CRS("ReportBasePath"));
|
|
//localReport.ReportPath = @".\Reports\ReportVisita.rdlc";
|
|
|
|
// 2) caricamento tab dati
|
|
DataTable tabRepVis = new DataTable();
|
|
tabRepVis = (DataTable)DtProxy.man.taRepVis.GetData(memLayer.ML.IntSessionObj("IdxPaziente"), DataVisita);
|
|
|
|
// 3) inserimento dataset nel report
|
|
localReport.DataSources.Clear();
|
|
localReport.DataSources.Add(new ReportDataSource("dsValue", tabRepVis));
|
|
|
|
// 4) aggiungo parametro
|
|
ReportParameter filtroPag;
|
|
if (userIsMedicoRef)
|
|
{
|
|
filtroPag = new ReportParameter("PrintPage", "0");
|
|
}
|
|
else
|
|
{
|
|
filtroPag = new ReportParameter("PrintPage", "1");
|
|
}
|
|
localReport.SetParameters(filtroPag);
|
|
}
|
|
/// <summary>
|
|
/// determina se utente sia MEDICO REFERTANTE o meno da diritti user
|
|
/// </summary>
|
|
public bool userIsMedicoRef
|
|
{
|
|
get
|
|
{
|
|
bool answ = false;
|
|
try
|
|
{
|
|
answ = devicesAuthProxy.stObj.userHasRight("MedicoRef");
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
}
|
|
} |