Free Support Forum - aspose.com

How To Get static text in an Excel cell to repeat with every record while using WorkbookDesigner

I want static text put in an Excel cell to be repeated with every record/row when WorkbookDesigner processes the smart markers that the text is "inside of".

For example starting with this code:
Connection con = DriverManager.getConnection(dbUrl);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select biddername,bidamount from bid_desk");
WorbookDesigner wb = new WorkbookDesigner();
wb.open("template.xls");
wb.setDataSource("Bids",rs);
wb.process();
wb.save("output.xls");

If I have 3 records: Larry $50 bid, Moe $40 bid, Curly $55 bid. This is what I want to end up with:

A1 B1 C1
Larry Bid Amount $50
Moe Bid Amount $40
Curly Bid Amount $55

The question is how to structure the static text "Bid Amount" in cell B1 so that it ends up repeating without embedding it in the resultset's query.

Having this as the smart markers:

A1 B1 C1
&=Bids.biddername Bid Amount &=Bids.bidamount

Results in this undesirable output.

A1 B1 C1
Larry Bid Amount $50
Moe $40
Curly $55

Any thoughts or suggestions?

Hi,

Well, I think you may place a repeat dynamic formula in B1 cell e.g &=&=“Big Amount” to place static text in each record processed by Smart markers for your requirement.

See the complete topic in the documentation: Smart Markers

Thank you.