Ciao ragazzi. Come ho scritto in oggetto, mi funziona perfettamente in locale, ma quando lo lancio online, mi si apre la pagina vuota, non vedo nemmeno la struttura del crystaviewer.
Anche se un pò lungo vi posto il codice completo.
E' molto urgente grazie mille in anticipo.
<%@ Page Language="VB" Debug="true" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import NameSpace="System.Data" %>
<%@ Import NameSpace="System.Data.OleDb" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.IO" %>
<%@ Import NameSpace="System.Drawing.Text" %>
<%@ Import NameSpace="System.Drawing.Drawing2D" %>
<%@ Import NameSpace="System.Drawing.Imaging" %>
<%@ Import NameSpace="CrystalDecisions.Shared" %>
<%@ Import NameSpace="CrystalDecisions.reportsource" %>
<%@ Import NameSpace="CrystalDecisions.web" %>
<%@ Import NameSpace="CrystalDecisions.CrystalReports.Engine" %>
<script runat="server">
Dim cn As OleDbConnection
Dim dap As OleDbDataAdapter
Dim dst As DataSet
Dim dap1 As OleDbDataAdapter
Dim dst1 As DataSet
Dim dap2 As OleDbDataAdapter
Dim dst2 As DataSet
Dim dbc As New OleDbCommand
Dim cmd As OleDbCommand
Dim Password As String
Dim sql As String
Dim Nome As String, k As Integer
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("mdb-database/Dati2.mdb"))
If Request("Doc") = "Fattura" Then
sql = "select * from DettaglioFatture where IDMovimento=" & Request("ID")
End If
dap = New OleDbDataAdapter(sql, cn)
dst = New DataSet
dap.Fill(dst, "Fatture")
Dim cr As New CrystalDecisions.CrystalReports.Engine.ReportDocument
If Request("Doc") = "Fattura" Then
cr.Load(Server.MapPath("DocumentoFatture.rpt"))
sql = "select * from Query_DettaglioFattureSomma where IDMovimento=" & Request("ID")
dap2 = New OleDbDataAdapter(sql, cn)
dst2 = New DataSet
dap2.Fill(dst2, "Somma")
Dim Totale As Double
Dim Imponibile As Double
Dim Imposta As Double
Session("Imponibile") = "" : Session("Imposta") = "" : Session("Iva") = "" : Session("Totale") = ""
Session("TotImponibile") = 0 : Session("TotImposta") = 0 : Session("Netto") = 0
If dst2.Tables("Somma").Rows.Count > 0 Then
For q = 0 To dst2.Tables("Somma").Rows.Count - 1
With dst2.Tables("Somma").Rows(q)
Imponibile = .Item("SommaDiImponibile")
Session("Imponibile") = Session("Imponibile") & Format(.Item("SommaDiImponibile"), "#,##0.00") & Chr(13)
Session("TotImponibile") = Session("TotImponibile") + Imponibile
Imposta = Imponibile / 100 * .Item("Iva")
Session("Imposta") = Session("Imposta") & Format(Imposta, "#,##0.00") & Chr(13)
Session("TotImposta") = Session("TotImposta") + Imposta
Totale = Imponibile + Imposta
Session("Totale") = Session("Totale") & Format(Totale, "#,##0.00") & Chr(13)
Session("Iva") = Session("Iva") & .Item("Iva") & "%" & Chr(13)
End With
Next
End If
End If
Dim txt
txt = cr.ReportDefinition.Sections("Section2").ReportObjects("ModalitàPagamento")
txt.Text = "kjbfdkvhdkfh" 'Session("ModalitàPagamento")
txt = cr.ReportDefinition.Sections("Section2").ReportObjects("Riferimenti")
txt.Text = "lrjegolj" ' Session("Riferimenti")
cr.DataDefinition.FormulaFields("RagioneSociale").Text = "'" & Session("RagioneSociale") & "'"
cr.DataDefinition.FormulaFields("Indirizzo").Text = "'" & Session("Indirizzo") & "'"
cr.DataDefinition.FormulaFields("Comune").Text = "'" & Session("Comune") & "'"
cr.DataDefinition.FormulaFields("Piva").Text = "'" & Session("Piva") & "'"
cr.DataDefinition.FormulaFields("Lotto").Text = "'" & Session("Lotto") & "'"
cr.DataDefinition.FormulaFields("TipoDocumento").Text = "'" & Session("TipoDocumento") & "'"
cr.DataDefinition.FormulaFields("DataDocumento").Text = "'" & Session("Data") & "'"
cr.DataDefinition.FormulaFields("NumeroDocumento").Text = "'" & Session("NumeroDocumento") & "'"
txt = cr.ReportDefinition.Sections("Section5").ReportObjects("Imponibile")
txt.Text = Session("Imponibile")
txt = cr.ReportDefinition.Sections("Section5").ReportObjects("Iva")
txt.Text = Session("Iva")
txt = cr.ReportDefinition.Sections("Section5").ReportObjects("Imposta")
txt.Text = Session("Imposta")
txt = cr.ReportDefinition.Sections("Section5").ReportObjects("Totale")
txt.Text = Session("Totale")
cr.DataDefinition.FormulaFields("TotImponibile").Text = "'" & Format(Session("TotImponibile"), "#,##0.00") & "'"
cr.DataDefinition.FormulaFields("TotImposta").Text = "'" & Format(Session("TotImposta"), "#,##0.00") & "'"
cr.DataDefinition.FormulaFields("Netto").Text = "'" & Format(Session("TotImponibile") + Session("TotImposta"), "#,##0.00") & "'"
CrystalReportViewer1.ReportSource = cr
cr.SetDataSource(dst.Tables("Fatture"))
End Sub
Function fApici(ByVal stringa)
fApici = Replace(stringa, "'", "''")
End Function
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body style="background-color:Blue">
<form id="form1" runat="server">
<div align="center">
<div>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" Height="1039px" Width="800px" />
</div>
</div>
</form>
</body>
</html>