Code Monkey home page Code Monkey logo

crispin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

crispin's Issues

<a> tags aren't made into links in PDFs

If you have an a tag inside a htmlBlock, it doesn't get converted to a link in the resulting PDF using PdfReportConverter and XrptToXslFo.xslt. Dumping out the href into the report works but that is probably just Adobe Reader finding URLs and marking them up. I'm not sure how/if XSL-FO supports links natively.

Links don't work in the HtmlReportConverter either, this is detailed in issue #5.

<a> tags aren't made into links in the HTML converter

If you have an a tag inside a htmlBlock, it doesn't get converted to a link in the resulting HTML when processed by the HtmlReportConverter. It will need to be picked up in XrptToHtml.xslt.

There is a related issue with links not working in PDFs (#4).

Byte order marks are killing XML loading

Byte order marks at the start of input strings are killing the calls to xml.LoadXml in the converters.

The correct way to handle this would be to use a memory stream with the correct encoding:

xml.Load(new MemoryStream(Encoding.UTF8.GetBytes(xrpt)));

But this may bork on non-UTF8 inputs. The easiest way is to strip the BOM:

xrpt = xrpt.Trim().Trim(new char[]{'\uFEFF','\u200B'});

Upgrade IKVM to 8.x

Will require rebuilding the FOP DLL. I tried upgrading it and things stopped working. Possibly related, possibly not, I didn't have time to investigate fully.

Table cell background colours aren't showing in HTML exports

Given this report:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE report [
    <!ENTITY nbsp "&#160;">
    <!ENTITY ldquo "&#8220;">
    <!ENTITY lsquo "&#8216;">
    <!ENTITY rdquo "&#8221;">
    <!ENTITY rsquo "&#8217;">
    <!ENTITY quot "&#34;">
]>
<report>
  <title>Table background test</title>
  <content>
    <pageSequence orientation="portrait">
        <htmlBlock>
            <table>
                <col width="50%" />
                <col width="50%" />
                <tbody>
                    <tr>
                      <td background-color="#F2385A">&nbsp;</td>
                      <td background-color="#F5A503">&nbsp;</td>
                    </tr>
                </tbody>
            </table>
            <br />
        </htmlBlock>
    </pageSequence>
  </content>
</report>

Generating a PDF produces a bar with the correct background colours:

table cell background pdf

But the HTML export of the same report produces a blank report. The problem seems to be that the style attribute generated by the XSL transform (in XrptToHtml.xslt) is messed up:

<table cellpadding="0" cellspacing="0" class="layoutTable">
  <col width="50%" />
  <col width="50%" />
  <tbody>
    <tr>
      <td style="&#xD;&#xA;        background-color: &quot;#F2385A&quot;;&#xD;&#xA;      ">&nbsp;</td>
      <td style="&#xD;&#xA;        background-color: &quot;#F5A503&quot;;&#xD;&#xA;      ">&nbsp;</td>
    </tr>
  </tbody>
</table>

Table nested in a table td doesn't respect the containing td's align value

<htmlBlock>
    <table>
        <col width="50%"/>
        <col width="50%"/>
        <tbody>
            <tr>
                <td>&nbsp;</td>
                <td align="right">
                    <table type="DataGrid">
                        <col width="10%"/>
                        <col width="10%"/>
                        <tbody><tr><td>ONE</td><td>TWO</td></tr></tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
</htmlBlock>

I would expect the nested table to be aligned to the right of the containing cell, however it is left aligned.

Suggestions - to give more power to this report

Try to allow any XHTML to be converted/parsed.
There are free tools that makes from a HTML XHTML.

What you should (could) do:

  1. Remove the check if it's your type of report:

@* Generator: Template *@

<!ENTITY ldquo "&#8220;">
<!ENTITY lsquo "&#8216;">
<!ENTITY rdquo "&#8221;">
<!ENTITY rsquo "&#8217;">
<!ENTITY quot "&#34;">

]>

  1. Except /report/content/pageSequence your reports are a normal XHTML documents. The most important XHTML tags are already transformed by the supported XSLT.

So if you modify the structure a bit, it could be a HTML to XHTML to PDF/CSV converter.

  1. Don't fully understand why you need to generate templates into CS. Razor can do this on the fly, precompiled code can be cached (f.e. static variable inside class)...

  2. Examples are cool, documentation would be even better.

DTD for the XRPT format

There should be a DTD for the XRPT XML format. Documentation of the format should be created as part of the DTD.

Left padding a table causes layout issues in a PDF

Left padding a table causes the table to just be pushed right, so the table still has the same width. Example XRPT that shows this:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE report [
    <!ENTITY nbsp "&#160;">
    <!ENTITY ldquo "&#8220;">
    <!ENTITY lsquo "&#8216;">
    <!ENTITY rdquo "&#8221;">
    <!ENTITY rsquo "&#8217;">
    <!ENTITY quot "&#34;">
]>
<report>
    <title>Left padded table</title>
    <content>
        <pageSequence orientation="portrait">
            <htmlBlock>
                <h1>Left padded table</h1>
            </htmlBlock>

            <contentBlock padding-left="1.1cm">
                <table>
                    <col width="50%" />
                    <col width="50%" />
                    <thead>
                        <tr>
                            <th align="left">Name</th>
                            <th align="right">ID</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr><td>Ben</td>        <td align="right">123</td></tr>
                        <tr><td>Justine</td>    <td align="right">456</td></tr>
                        <tr><td>Ann</td>        <td align="right">445</td></tr>
                    </tbody>
                </table>
            </contentBlock>
        </pageSequence>
    </content>
</report>

This results in the ID column being cut off on the right-hand side of the page. This is caused by the calculation used to determine column widths in XrptToXslFo.xslt - search for <xsl:template match="col">. It uses the page width, adjusting down for nested table padding, but doesn't take into consideration padding values specified in other containing elements.

NuGet package, swxben.reporting.System.Web

I Can't Believe It's Not System.Web

A minimalist copy of things found in System.Web that are needed to fool RazorGenerator.Templating into letting us use Razor tricks like helpers and IHtmlString. Implemented as a new NuGet package that can be both discreetly and discretely dropped in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.