Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:57:24+00:00 2026-06-10T10:57:24+00:00

I just want to put some values from my database on an A4 page

  • 0

I just want to put some values from my database on an A4 page (I have a JPG template)
and create a PDF book/report with an insert per page.
I have easily done it with NetBeans Java Jasper Reports using iReport editor.

It seems so much more difficult in Visual Studio C# Crystal Reports.
I’ve really searched for tutorials for Crystal Reports and none of them
is using an A4 image as a template. Please help me if you know any such tutorials.

I prefer a solution which works programmatically and not through a wizard.
I already manage my database with my program. I just need the report and some
documentation of how to give input values to the report. I don’t even
need for the report to access the database. I can get all the values in my
program. The best solution for me is a template with my JPG file as background
and boxes (like textboxes) where I give text from my program through parameters
of a function. Like Jasper Reports / iReport.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:57:25+00:00Added an answer on June 10, 2026 at 10:57 am

    OK, I spend some time to find an easy solution and I got the following:

    First of all I didn’t use Crystal Reports, but Windows Reports (rdlc files).
    Windows Reports are more simple and easy and it is possible to add an image as a background
    and above this image some TextBoxes that refer to String parameters (exactly what I needed). They are in Visual Studio by default and you design your report in Visual Studio (right click in Solution Explorer –> Add Report)

    Then I found a code sample which converts the report to PDF files and I used it to write the following Class:

    public class XReport
    {
        private ReportViewer reportViewer = new ReportViewer();
    
        public XReport()
        {
        }
        public XReport(String reportFilePath)
        {
            setReportFile(reportFilePath);
        }
        // set rdlc file
        public void setReportFile(String reportFilePath)
        {
            reportViewer.Reset();
            reportViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
            reportViewer.LocalReport.ReportPath = reportFilePath;
        }
        public void setParameters(List<ReportParameter> parameters)
        {
            reportViewer.LocalReport.SetParameters(parameters.ToArray());
            reportViewer.LocalReport.Refresh();
        }
        public void setParameters(Dictionary<String, String> parameters)
        {
            XList<ReportParameter> parameterList = new List<ReportParameter>();
            XList<String> parameterKeys = parameters.getKeys();
            foreach (String parameterKey in parameterKeys) {
                parameterList.Add(new ReportParameter(parameterKey, parameters.get(parameterKey))); }
            setParameters(parameterList);
        }
        public void exportToPDF(String pdfFilePath)
        {
            Warning[] warnings;
            string[] streamids;
            string mimeType = string.Empty;
            string encoding = string.Empty;
            string extension = string.Empty;
            byte[] bytes = null;
            // render PDF file
            try { bytes = reportViewer.LocalReport.Render( "PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings); }
            catch (Exception ex) { System.Console.Write(ex.Message); }
            // write PDF file
            using (FileStream fs = new FileStream(pdfFilePath, FileMode.Create)) { fs.Write(bytes, 0, bytes.Length); fs.Close(); }
            // release reportViewer resources to avoid errors
            reportViewer.LocalReport.ReleaseSandboxAppDomain();
        }
    }
    

    It works. Try it. Be careful with 2 things:

    • Use correct paths for reportFilePath and pdfFilePath. (pdfFilePath worked only with non-relative path for me)

    • Make sure that you have added all parameters with their correct names in your rdlc report. You can add them at View –> Report Data –> Add New Parameter (right click at Parameters). Also see this: Create a parameter in rdlc report

    Hope I helped. It worked for me great.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two jobs on Hudson, A & B. I just want to put
I have a snippet of code where I first put some values in to
So I have a PHP backend that pulls some data from SQL, let's just
Basically I just want to put new.gif in the top left corner of the
Just want to know how to read an attribute of a parent node from
I have a class library which I want to call from my .NET application
I have a form, and before it submits I want to check some of
HI I have a table with some some values (IDs), and of course when
I want to sent some information through a from, executing a php file that
We have a SaaS web app and are looking to get some feedback from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.