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 9127043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:11:31+00:00 2026-06-17T07:11:31+00:00

I have found that one of the Microsoft Reporting controls (the Chart) is inadequate

  • 0

I have found that one of the Microsoft Reporting controls (the Chart) is inadequate for my needs. Since these controls aren’t extensible, I’ve extended the functionality of a WPF control and am saving the control as a graphic. Unfortunately, ReportViewer’s image control doesn’t support vector graphics, either. Therefore my goal is to generate the PDF from ReportViewer with certain “placeholders” (e.g. a rectangle item), and then come behind with iTextSharp and add the vector graphic on top of these placeholders. Since the report length flows based on the input data, I can’t know the coordinates of these placeholders before getting them.

I can’t think of a way to include a PDF field in the RDLC, which would be nice since iText has the GetFieldPosition() method. Furthermore I know there is iText’s PDFWriter.GetVerticalPosition() method, but this is really only useful if you’ve moved the cursor to that location in the PDFWriter. Truth is, I’m still trying to get my head around iText and PDF. It is vast.

So my two questions that refer to each other:

  1. What kind of placeholder should I use in the RDLC designer that can be systematically identified afterwards and have its position queried?
  2. How would I go about getting this position?

Thanks in advance!

-Brandon

  • 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-17T07:11:32+00:00Added an answer on June 17, 2026 at 7:11 am

    My imperfect, but working solution is to use text item placeholders that match the background to mark the positions in the .RDLC report. After generating the PDF, these are identified by way of inheriting iTextSharp’s LocationTextExtractionStrategy (as per this entry by greenhat). In my current test environment the above is copy-pasted verbatim and only deviates in the RenderText() override, which does not add the TextChunk to the list unless info.GetText() is an appropriate placeholder string.

    Snippet of placeholder extraction:

    PdfReader reader = new PdfReader(fileName);
    LocationTextExtractionStrategyEx strat = new LocationTextExtractionStrategyEx();
    for (int i = 1; i <= reader.NumberOfPages; i++)
       PdfTextExtractor.GetTextFromPage(reader, i, strat);
    

    The native vector image type is WMF, and can be inserted at the absolute location of the placeholder text. To do so for the first placeholder in the list, then:

    using (FileStream fs = new FileStream("output.pdf", FileMode.Create, FileAccess.Write, FileShare.None))
    {
       using (PdfStamper stamper = new PdfStamper(reader, fs))
       {
          using (Stream wmfStream = new FileStream(@"C:\Paint.wmf", FileMode.Open, FileAccess.Read, FileShare.Read))
          {
             Image replacementVectorImage = Image.GetInstance(wmfStream);
             replacementVectorImage.SetAbsolutePosition(strat.TextLocationInfo[0].TopLeft[0],     strat.TextLocationInfo[0].BottomRight[1]);
             PdfContentByte cb = stamper.GetOverContent(1);
             cb.AddImage(replacementVectorImage);
          }
       }
    }
    

    Thanks to mkl and VahidN for your valuable input!

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

Sidebar

Related Questions

We've recently upgraded one of our SSRS2005 servers to SSRS2008 and have found that
I have found a number of articles such as this one that talk about
I have found that I have no problem using require to load something like
I have found that call stack helps in finding the line number of a
I have found that it is impossible to write ( file_put_contents or simple fwrite
I have found that how to determine what columns are primary key column of
I have found that I often have to implement some sort of a scheduler
I have found that creating a zip file using the Zip task provided by
We have found that with our memcache some keys tend to be lost. To
I have found that dragend event in Google Map also trigger the click event

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.