Free Support Forum - aspose.com

SmartMarker problem and question

Hello,

We are evaluating Aspose.Excel and other products to generate and read excel documents, and we are interested in the SmartMarker functionality.

But we have a problem and a questions :

- Problem : When using "horizontal" (for exemple "&=Table.Parametre(horizontal)"), it adds only the data and not format informations to the new colums : in normal mode (vertical), both are duplicated on the new rows : is it a bug in horizontal mode ???

- Question : Our application write and read excel documents : user will add data to a preformated document that has initialy been generated. We have seen how to use the object model (Cells collections and so on...) to read data, but is there a way to use SmartMarker for this reading, for example we give an excel template with markers and an excel document with data and that can match the added data ?

Best regards,

Olivier Huet

Hi Oliver,

Thanks for considering Aspose.Excel.

1. For the horizontal issue, I will check it. Are you using v3.5.2?

2. Using SmarkMarker for reading is an excellent idea. Could you elaborate how do you want to use smart marker for reading? That will help us design this feature.

Hello,

1. yes : I initialy downloaded 3.5.1 but updated it before posting and it is the same with 3.5.2.

2. We are using SmartMarker for exporting data and object model to import data : to have SmartMarker while importing data too, basicaly I was thinking of someting like a mecanism where we give a template document with markers and another document in a similar format and with data filled by an user, and a DataSet to fill : there could be a matching between the template document and the document with data.

But in our future application, it's perhaps not easy to describe it only with markers : we have data on the left columns and on top columns : that should be converted in tables in a dataset. --> this can perhaps be described with markers, but :

We have data inside : at each crossing of rows and column, there is a data that should be inserted in another table : and this table have a relation to what is in the top column and in the left column (see previous paragraph). --> this is perhaps more difficult to do this with only markers : the syntax to describe this and the needing of other people too would perhaps not be very simple.

But for now, we can do this with the object model : we are only trying the functionality to do what we need (or will need) in our application : to know if we will use Aspose.Excel or something else.

Best regards,

Olivier Huet

Hi Olivier,

1. We will check and fix this issue ASAP.

2. Do you mean you have a table in another Excel file? You want to retrieve table data and populate to another file with smart markers?

If yes, I think you can use Cells.ExportDataTable or Cells.ExportDataTableAsString method to export data in source file to a DataTable then use smart markers to populate them to the destination file.

If I don't understand your needs correctly, please create sample files to show your needs. Thank you very much.

Please try this attached fix. The first issue is solved.

Hello,

Thanks but it looks like this patch 3.5.2.6 has some problems : I tried it with the my previous test, and :

- it has the same result in horizontal mode (the style is not propaged)

- in vertical mode, I have now the error :

System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.

Server stack trace:
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at Aspose.Excel.Cells.( , FileFormatType )
at Aspose.Excel.Worksheet.( )
at Aspose.Excel.Worksheets.( )
at Aspose.Excel.Worksheets.(FileFormatType )
at Aspose.Excel.Excel.Save(Stream stream, FileFormatType fileFormatType)

I can send you the excel file templates if you want - the code is something like :

// conversion :

Aspose.Excel.ExcelDesigner designer = new Aspose.Excel.ExcelDesigner();

designer.Open(FormatApplicationPath(templateFile));

designer.SetDataSource(data);

designer.Process();

designer.Excel.Save(stream, formatExcel);

where formatExcel is Excel97 or Excel2000 and data is a dataset with a table.

Best regards,

Olivier Huet

Hi Olivier,

Could you please post your designer file here? And how many rows of data in your dataset? Thank you.

Hello,

See attachement :

- DataSetStationsTest.xml is a dataset that can be read with DataSet.readXml()

- FeuilleReleveHorizontale.xls works well in 3.5.2.0 but do the mentionned exception in 3.5.2.6

- FeuilleReleveVerticale.xls add the data in 2 releases, but it doesn't propagate the style (borders ...)

Note that I'm in .Net Framework 2.0 beta 2, but as the exception does not occurs in 3.5.2.0, I think that it's not related to my .Net framework version.

Best regards,

Olivier Huet

Hi Olivier,

Thanks for you help.

I figure out the problem. Please try this attached fix. And to make the horizontal mode work better, I made a slight change in your template file.

Hello,

Thanks a lot, it works very well now.

And for the other point that I spoke about, I can do it by code : with Cells properties and methods, but what I said previously is that it would be great to give a template (with smart tags) and a "filled template" to automatically rebuild a dataset with the filled data : it is what I said as "using SmartTags for reading".

But as I have some other process to do (read the cells at the cross of the lines and the columns) so I have to do it by code, but I think that this would be an interresting feature.

Best regards,

Olivier Huet