:net9, Blazor y SQL Server

9 views
Skip to first unread message

Carlos Díaz

unread,
Mar 25, 2026, 3:28:11 PM (7 days ago) Mar 25
to reportman
Hola, hay una guia o ejemplo de como utilizar reportman con .net, blazor y sql server?

Logré mostrarlo al reporte con un texto solamente, pero no puedo configurarlo con sql server y datos de un store proc

tengo este codigo en un Service

        public byte[] GeneratePdf(string reportName, Dictionary<string, object> parameters)
        {
            try
            {

                using (Report rp = new Report())
                {
                    string reportPath = Path.Combine(_env.ContentRootPath, "Reports", reportName);
                    rp.LoadFromFile(reportPath);
                    rp.ConvertToDotNet();

                    var cn = _config.GetConnectionString("GCConnection");
                    var sqlConnection = new SqlConnection(cn);

                    rp.DatabaseInfo["DB"].Connection = sqlConnection;
                    rp.AsyncExecution = false;

                    PrintOutPDF pdf = new PrintOutPDF();
                    //pdf.FileName = "prueba.pdf";
                    //pdf.Compressed = true;
                    if (pdf.Print(rp.MetaFile)) {
                        using (MemoryStream ms = new MemoryStream())
                        {
                            pdf.PDFStream.Position = 0;
                            pdf.PDFStream.CopyTo(ms);
                            return ms.ToArray();
                        }
                    }
                    return null;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
Reply all
Reply to author
Forward
0 new messages