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

  • Home
  • SEARCH
  • 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 7625247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:09:59+00:00 2026-05-31T05:09:59+00:00

I’m developing a report in Crystal Reports and need to render some math formulas

  • 0

I’m developing a report in Crystal Reports and need to render some math formulas and equations in it. The formulas and equations are stored in a SQL Server database in plain text (using LaTeX markup).

Getting them to render in HTML is not a problem, because I’m using MathJax to do the work at browser level (in either HTML/CSS or MathML).

The real problem is: how can I get these equations rendered in the report? I’ve searched throught the web and found nothing about it. Doing some more search at the Crystal interface, the only thing I’ve found is inserting the (obsolete) “Microsoft Equation Editor” as a OLE object in the report, but neither this worked.

So, how render these LaTeX math equations in this Crystal report? Is there some (obscure) component/plugin that does the job? If not, is there a better manner of doing this? Someone already got and resolved a similar use-case?

OBS 1: I must have this report generated in PDF because of already validated standards in use at my job.

OBS 2: The app which will generate this report is a ASP.NET MVC 3 web app, with a SQL Server 2008 database (using NHibernate).

  • 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-05-31T05:09:59+00:00Added an answer on May 31, 2026 at 5:09 am

    I’ve found a workaround that is at the same time elegant and not relies on extending the Crystal Reports using C.

    I’ve found this small and simple “latex equation renderer”: mimeTeX. Using it, I’m able to render latex equations into GIF images (as a CGI application). With that, I created a phantom byte array field in the datatable where the report is getting data.

    Here is what I’ve done:

    1. Recover the latex equation markup from my real database;
    2. Query mimeTeX using this markup and mimeTeX returns a gif image;
    3. Take this image and convert it to png format (Crystal surprisingly do not support GIF files);
    4. Finally put this PNG image (its bytes) in the phantom field created in the datatable used by the report;
    5. Now you can use this field in the report! The images for each record (equation) are generated and displayed without problems!

    The only drawback I’ve found until now using this approach is that all the images are streched to the same size of the field placeholder. If the images have sizes that varies much, some will be displayed pixelated and others will become “squashed”. But I’m looking forward how to resolve this issue!

    — Edit —

    Solved the “squashed images” problem. I resize the images in code maintaining their aspect ratio and “pasting” them in a fixed size image. Now all the images get the same size and doesn’t get squashed!

    Here is the code for the resizing:

    MemoryStream ResizeImage(Stream OriginalFile, int NewWidth, int MaxHeight, bool OnlyResizeIfWider)
    {
        int finalWidth = NewWidth;
        int finalHeight = MaxHeight;
    
        System.Drawing.Image FullsizeImage = System.Drawing.Image.FromStream(OriginalFile);
    
        // Prevent using images internal thumbnail
        FullsizeImage.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
        FullsizeImage.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
    
        if (OnlyResizeIfWider)
        {
            if (FullsizeImage.Width <= NewWidth)
            {
                NewWidth = FullsizeImage.Width;
            }
        }
    
        int NewHeight = FullsizeImage.Height * NewWidth / FullsizeImage.Width;
        if (NewHeight > MaxHeight)
        {
            // Resize with height instead
            NewWidth = FullsizeImage.Width * MaxHeight / FullsizeImage.Height;
            NewHeight = MaxHeight;
        }
    
        System.Drawing.Image NewImage = FullsizeImage.GetThumbnailImage(NewWidth, NewHeight, null, IntPtr.Zero);
    
        // Clear handle to original file so that we can overwrite it if necessary
        FullsizeImage.Dispose();
    
        MemoryStream bmpStream = new MemoryStream();
    
        // Put in a new image of A x B pixels to evict distortion
        using (var bitmap = new Bitmap(finalWidth, finalHeight))
        {
            using (var canvas = Graphics.FromImage(bitmap))
            {
                canvas.InterpolationMode = InterpolationMode.HighQualityBicubic;
                canvas.Clear(Color.White);
                canvas.DrawImage(NewImage, 0, 0);
                canvas.Save();
            }
    
            bitmap.Save(bmpStream, ImageFormat.Bmp);
        }
    
        return bmpStream;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to

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.