Release with Report does not run on other Pcs

Asked

Viewed 122 times

0

I created a Winform that contains Reports searching for data on an object DataSet (which is programmatically populated using an SQL Server source).

The release is stored on the server and can be accessed by client machines. The problem is what executable only runs on me PC. In others an error of the type is generated:

System.IO.FileNotFoundException

The report files rdlc and the object Dataset xsd are configured with build action as Embedded Resource.

I believe to be the reference to some of these objects that is configured wrong, but I can’t find where.

Help me out, please?

Remember that the exception described above is generated in windows error report on running system on client Pcs, not in debug

Follow the code that populates the data from a Datatable dtComissoes:

ds = new dsComissoes();
dsTableComissoes = ds.Tables["dtComissoes"];
foreach (DataRow row in dtComissoes.Rows)
{
    int i = dsTableComissoes.Rows.Count;
    dsTableComissoes.Rows.Add();
    dsTableComissoes.Rows[i]["CodConta"] = row["CodConta"];
    dsTableComissoes.Rows[i]["Descricao"] = row["Descricao"];
    dsTableComissoes.Rows[i]["NumOrdem"] = row["NumOrdem"];
    dsTableComissoes.Rows[i]["Cliente"] = row["Cliente"];
    dsTableComissoes.Rows[i]["NF"] = row["NF"];
    dsTableComissoes.Rows[i]["Item"] = row["Item"];
    dsTableComissoes.Rows[i]["CondPagto"] = row["CondPagto"];
    dsTableComissoes.Rows[i]["Titulos"] = row["Titulos"];
    dsTableComissoes.Rows[i]["Parcela"] = row["Parcela"];
    dsTableComissoes.Rows[i]["ValorItem"] = row["ValorItem"];
    dsTableComissoes.Rows[i]["Comissao"] = row["Comissao"];
    dsTableComissoes.Rows[i]["PTN"] = row["PTN"];
    dsTableComissoes.Rows[i]["Valor"] = row["Valor"];
    dsTableComissoes.Rows[i]["Linha"] = row["Linha"];
}

And the code passed to generate the report:

dtComissoesBindingSource.DataSource = dtComissoes;
            rpvComissoes.LocalReport.SetParameters(new ReportParameter("DataInicial", DataInicio.ToString()));
            rpvComissoes.LocalReport.SetParameters(new ReportParameter("DataFinal", DataFim.ToString()));
            rpvComissoes.LocalReport.Refresh();
            rpvComissoes.RefreshReport();
            rpvComissoes.Refresh();
  • Crystalreports?

  • I use the Visual Studio Report. I think Crystalreports too slow to load.

  • Put the code where you "load" this report to throw the dice to it.

  • Posted @Jéfersonbueno

  • 1

    I usually use the RDLC as Content. However, if the PC running the APP does not have SQL Server and the Reporting Dlls installed, an error may occur. The solution I found was to send the Sql server and Reporting Dlls along with my Dlls

  • Actually I wanted to see the code that passes the DataTable for the Report hehe

  • What Dlls are Needed @Richarddias?

  • 1

    The Dlls that are referenced in your project that are related to report generation and SQL server. Now I won’t be able to name each one specifically, but it is a way for you to follow and possibly solve your problem

Show 3 more comments

1 answer

0

I solved the problem by installing two Nuget Packages:

Microsoft Report Viewer
Microsoft.Sql.Server.Types

I thought it was better than just copying the Dlls. Thanks to @Richard Dias who showed me the paths of stones.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.