ASP.Net MVC 3 iTextSharp pdf table borders - asp.net-mvc-3

I have a page of my asp.net project to be output as pdf from html. Everything was fine except table borders. It seems like iTextSharp library only read table border="1" rather than table style="border-top:1px solid #333". I didn't manage to style the table to be display as I wish in the pdf page. Any idea how can I style it?

Related

Passing HTML content to a ASP.NET MVC core view component (Content projection)

I want to use a view component to create a component for a dialog element.
So the most of the HTML for the element is fixed (like the dialog element, the close button etc), but the content (what I want to show in the dialog itself) is different for every instance.
So what I want to do is bring the different content to the view component.
I know I can put it in a model, like this
<vc:dialog data=#Model></vc:dialog>
but then I have to capture all different possibilities of HTML in a model/object structure.
And the HTML can differ from 1 line of text to 5 lines of text to header/body/footer to 5 charts with text.
Now in Angular components, I can do this:
<vc:dialog>
1 line of HTML
</vc:dialog>
<vc:dialog>
5 lines of HTML
</vc:dialog>
<vc:dialog>
100 lines of HTML
</vc:dialog>
and in the component itself, you can use that HTML (it's called content projection).
Is there a way to accomplish this is in a view component?
EDIT
I just saw a piece about Razor components (https://learn.microsoft.com/en-us/aspnet/core/blazor/components?view=aspnetcore-3.1) where this can be done, but Razor components are Blazor only?)

Kendo Grid sometimes renders data sometimes does not

I have a dynamic Kendo grid, for which I get the data every time from the server with the column configuration. The grids renders the data as expected, but sometimes the grid does not render the data at all and only renders the column headers. The grid does not even recognize the column configuration, which mentions whether the column is hidden or not, column title etc.
When I refresh(ctrl+f5) the browser page the grids starts displaying normally.
When I checked the html generated in both cases I saw following difference
1- The Grid which displays correctly
Has a thead and tbody inside a single table
2- The Grid which does not display the data
Has two different divs for header and content
Please see the following image for Good Grid
And following image for Bad Grid
I am not sure why the same grid has two different htmls? Can anyone please help?
EDIT
One more thing that might be helpful.
The kendo grid definition is in a content.html file. And this file is used as a content URL for kendo tabstrip control. There are around 7 tabs and all the tabs are refering to the same content file.

Sitecore CSS class layout for table in rich-text editor

I need to define my own styling for table like we have some default table CSS class layouts as shown below.
although after some Google I found solution that how to define class for specific row, cell, column or main class for table but not complete styling layout like above.
The Telerik website shows how to get your own custom table classes into their editor. See the link below for how to create the style sheet.
http://demos.telerik.com/aspnet-ajax/editor/examples/tablelayoutcssfile/defaultcs.aspx
Once you've created your style sheet you'll need to modify the EditorPage.aspx file which Sitecore uses to render the Telerik RadEditor control.
<site root>\sitecore\shell\Controls\Rich Text Editor\EditorPage.aspx
Add the following line as a property of the telerik:RadEditor control.
TableLayoutCssFile="~/sitecore/shell/Controls/Rich Text Editor/TableLayoutCss.css"
The above assumes the CSS file you created is named TableLayoutCss.css.

How could I link the items in the table of contents to their respective target pages?

I am currently using the XHTML2PDF library to turn html to PDF file,and generate the table of contents with page number behind based on some html tag such as H1, H2, this is really nice feature.
But my problem is the generated table of contents are static items, how could I turn them into clickable ones, when i click on it, I want it to take me to the target page.

column width jqgrid

I am using jqgrid to display the data in 10 columns. There is one column PillName, we can store PillName as 100 caharacters in Database. While displaying in jqgrid, its displaying like in the following image:
How to show the value in a proper way so that jqgrid dont get distorted. Ideally, it should break after some characters.
or It can show some 10 characters and then after that ........(dots)?
Kindly Help?
Thanks.
I suppose that you have CSS conflicts between MVC and jqGrid. One sees problems already in the input field of the jqGrid pager. The problem for example can be fixed with additional CSS definition
input.ui-pg-input { width: auto; }
The close problem you have probably with <td> or <tr> elements. You can examine the styles of the grid cell with Developer Tools of Internet Explorer of Chrome oder with Firebug. You can also make a simple test and comment the whole MVC CSS or a large parts of the CSS. I suppose that the grid will looks OK after removing unneeded CSS declaration or including the fix like with the pager in the CSS of your projects.

Resources