Issues in PrintTitleRows of Synfusion XlsIo - c#

I am using Syncfusion xlsIo version 14.2460.0.26.I have used PrintTitleRows to get the fixed header for every page. But it didn't work.
Here is the code snippet.
sheet1.PageSetup.TopMargin = 0.5;
sheet1.PageSetup.BottomMargin = 0.7;
sheet1.PageSetup.PrintTitleRows = "$6:$6";
sheet1.PageSetup.LeftMargin = 0.5;
sheet1.PageSetup.RightMargin = 0.2;
sheet1.PageSetup.Orientation = ExcelPageOrientation.Portrait;
sheet1.PageSetup.FitToPagesTall = 0;
sheet1.PageSetup.FitToPagesWide = 1;
sheet1.PageSetup.PaperSize = ExcelPaperSize.PaperA4;
Is there any way to get the header in each page.

This could be a document specific issue. So, please log on to Syncfusion support website and create incident regarding this issue for further updates.
http://www.syncfusion.com/Account/Logon?ReturnUrl=%2fsupport%2fdirecttrac
Regards,
Mohan.

Related

The type or namespace name 'Table' does not exist in the namespace 'iTextSharp.text'

Hi While working on this already written code, i am facing problem to resolve this issue. Please help me out.
In following code, itextsharp.text.table and cell does not exists issue was found, i added itexsharp dll to avoid it still it is not getting remove.
using iTextSharp.text;
using iTextSharp.text.pdf;
...
iTextSharp.text.Table dataTable = new iTextSharp.text.Table(2);
dataTable.DefaultHorizontalAlignment = Element.ALIGN_LEFT;
dataTable.DefaultVerticalAlignment = Element.ALIGN_MIDDLE;
dataTable.Border = 1;
dataTable.AutoFillEmptyCells = false;
dataTable.Padding = 1;
dataTable.SpaceInsideCell = 1;
dataTable.WidthPercentage = 100;
dataTable.Convert2pdfptable = true;
dataTable.TableFitsPage = true;
//=============Adding 01 Row==================
iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("images/LOGO4.GIF");
iTextSharp.text.Image address = iTextSharp.text.Image.GetInstance("images/address3.GIF");
Cell logo = new Cell(img);
dataTable.AddCell(logo);
Cell addres = new Cell(address);
dataTable.AddCell(addres);
...
Not able to resolve although i read number of related post and articles.
You are probably using an old version of a deprecated library version (Table has been replaced by PdfPTable) (iTextSharp/iText 5 has been deprecated in favor of iText 7, which has the exact same license model). In any case, you can check out documentation about tables for iTextSharp/iText 5 here and here. For iText 7, you can find similar documentation here and here (unfortunately, these are all Java examples, but the API is pretty much the same).

Adding page numbers to PDFs including the cover page

I'm trying to add a page number to the bottom of the page, which doesn't seem to work as expected.
Currently i'm using this:
<span class="page"></span>/<span class="topage"></span>
The problem with this solution is that it doesn't count the cover as a page.
So a 7 page PDF "has" 6 pages according to my code.
I'm looking for a way to include the Cover as a page, so the number is correct.
Currently i'm looking into some JS to manipulate it afterwards, but there have to me some "official" solution?
Solved using javascript. :)
If anyone are looking for the solution here you go:
var x=window.location.search.substring(1).split('&');
for (var i in x) {
var z=x[i].split('=',2);
vars[z[0]] = unescape(z[1]);
}
var pageNumberStart = parseInt(vars.page);
var pageNumberEnd = parseInt(vars.topage);
if (pageNumberStart != null && pageNumberEnd != null) {
document.getElementById('page').innerHTML = pageNumberStart + 1;
document.getElementById('topage').innerHTML = pageNumberEnd + 1;
}
Maybe someone got the official way to do it? :D

DocuSign SOAP API - Title Tab

I have the following code to add title tab to the DocuSign document - not a template - in C#.
It has worked up until now, but today the tab on the document comes up vertically, so all characters in the title show up vertically.
I am only seeing this when I go to correct the document on DocuSign web site. It does not show that way when I receive for signature. I was not correcting anything, but just checking to ensure that everything was as expected.
Instead of
Manager
it comes up as
M
a
n
a
g
e
r
How can I fix that? The code is below.
tab13.PageNumber = "17";
tab13.DocumentID = docId;
tab13.Type = DocuSignAPI.TabTypeCode.Custom;
tab13.CustomTabType = DocuSignAPI.CustomTabType.Text;
tab13.Name = "txtTitle";
tab13.Value = mgrTitle;
tab13.CustomTabTypeSpecified = true;
tab13.AnchorTabItem = new DocuSignAPI.AnchorTab();
tab13.AnchorTabItem.AnchorTabString = "Title:";
tab13.AnchorTabItem.Unit = DocuSignAPI.UnitTypeCode.Pixels;
tab13.AnchorTabItem.UnitSpecified = false;
tab13.AnchorTabItem.IgnoreIfNotPresent = true;
tab13.AnchorTabItem.UnitSpecified = true;
tab13.AnchorTabItem.YOffset = -20;
tab13.AnchorTabItem.XOffset = 50;
I am only seeing this when I go to correct the document on DocuSign web site. It does not show that way when I receive for signature. I was not correcting anything, but just checking to ensure that everything was as expected.

Not able to understand .Net Code

Is there any idea what he is doing in the below code at line
"chartSeries.AddItem(new ChartSeriesItem(listData[i].x, listData[i].y));"
I took this code from one forum.
http://www.telerik.com/community/forums/aspnet-ajax/chart/performance-problem-on-line-chart.aspx
I was not able to understand what kind of data holder it is?
Am pulling the data from in dataset format, If I could bind my dataset with listdata, I would acheive this development. But am not undestanding how I need to make this binding.
I have tried as below but didn't worked and throghing an error, please find the attached.
Dim listdata As new DataList
listdata.DataSource = ds.Tables.Item(0)
listdata.DataBind()
Original code took from forum
ChartSeries chartSeries = new ChartSeries("Altitude", ChartSeriesType.Line);
chartSeries.Appearance.ShowLabels = false;
incrementCount = 1;
for (int i = 0; i < listData.Count; i = i + incrementCount)
{
chartSeries.AddItem(new ChartSeriesItem(listData[i].x, listData[i].y));
}
RadChart2.AddChartSeries(chartSeries);
RadChart2.PlotArea.XAxis.AxisLabel.TextBlock.Text = "Distance (Miles)";
RadChart2.PlotArea.YAxis.AxisLabel.TextBlock.Text = "Yaxislabel";
I think its as simple as this, the error is that you can't use the word New, the code from the forum says to use new, capitalisation can make all the difference in .NET.

Get Current Client Silverlight Version?

I want to know if there is a way of using C# to get the Current Silverlight Version a user is running when opening a client of an app I'm developing.
It is for logging purposes.
I want to know if they are using Silverlight 3 or 4 on their browsers
var dotNetRuntimeVersion = Deployment.Current.RuntimeVersion;
var silverlightVersion = Environment.Version.ToString();
Supported in: 5, 4, 3
Using C# only I don't know, but what you could do is detect it with javascript and then send an ajax request to a function which lets the server know what version.
http://www.apijunkie.com/APIJunkie/blog/post/2009/04/How-to-programmatically-detect-Silverlight-version.aspx
The script above needs a bit of modifications to work with 4.0 but it should be easy enough.
Environment.Version might differ from plugin version. When I was using Silverlight 4 I managed to find version which had differ in major from plugin version and it seem there was no regularity.
There is way to get Silverlight Plugin version from JS and there is way to add JS to page and invoke it from Silverlight. So with code from here: http://www.visiblox.com/blog/posts/2010/04/29/determining-silverlight-version-installed/ I managed to do it this way:
var pScriptElement = HtmlPage.Document.CreateElement("script");
pScriptElement.SetAttribute("type", "text/javascript");
pScriptElement.SetProperty("text", "function GetSilverlightVersion(){var parts = Array(\"ver-major\", \"ver-minor\", \"ver-build\", \"ver-revision\");var nav = navigator.plugins[\"Silverlight Plug-In\"];var versionStr = \"\";if (nav) {versionStr = nav.description;} else {if(SilverlightIsInstalledOnIE)versionStr = GetSilverlightVersionOnIE();else versionStr = -1;}return versionStr;}function SilverlightIsInstalledOnIE(version){if(version == null)version = \"1.0\";var AgControl = new ActiveXObject(\"AgControl.AgControl\"); if(AgControl == null)return false;elsereturn AgControl.isVersionSupported(version);}function GetSilverlightVersionOnIE(){var currVersion = Array(1,0,0,0);for(var i=0;i<currVersion.length;i++){currVersion[i] = FindSupportedMaxVersionOnIE(currVersion, i,0,10000000);}return GetVersionString(currVersion);}function GetVersionString(versionArr,currVersion,index){if(index == null)index = -1;var versionStr = \"\";for(var i=0;i<versionArr.length;i++){if(i>0)versionStr += \".\";if(i==index)versionStr +=currVersion;elseversionStr += versionArr[i];}return versionStr;}function FindSupportedMaxVersionOnIE(versionArr, index,bottom,top){if(bottom >= top){return bottom;}var currVersion = bottom;var prevVersion = currVersion;var step = 1;while(currVersion<top){if(SilverlightIsInstalledOnIE(GetVersionString(versionArr,currVersion,index))){prevVersion = currVersion;currVersion += step;step *= 2;}elsereturn FindSupportedMaxVersionOnIE(versionArr, index,prevVersion,currVersion-1)}if(SilverlightIsInstalledOnIE(GetVersionString(versionArr,top,index)))return top;elsereturn FindSupportedMaxVersionOnIE(versionArr, index,prevVersion,top-1)}");
HtmlPage.Document.Body.AppendChild(pScriptElement);
var slVer = HtmlPage.Window.Invoke("GetSilverlightVersion", null);
This way I was able to get reliable plugin version on IE and other browsers. I've created my own class for parsing and comparing versions so I can easily check if user is using plugin from before fixes or with known malfunction.

Categories

Resources