When exporting Blade views using Laravel Excel, I can use a <h1> tag and it works fine unless I use it within a table cell.
If I use it within a table cell the content is output, but without the formatting. I realise I could listen for an event, then format the headings myself, but it would be far more convenient if Laravel Excel did it out of the box. Can it?
Related
There are several threads here on SO which are concerned with filling and formatting an Excel sheet out of Powershell. The concepts for this are easy, but creating a report in this way can quickly become cumbersome -- particularly when a nice format is desired.
Therefore, I want to get rid of the whole formatting and instead base the report on an existing template, for example looking like
The fields A2, B2 and C2 then shall be filled through a Powershell script.
The straightforward way to accomplish this would be to create the Excel template once and save it somewhere as a file. Then let the script open the template, fill it with data, and save it somewhere else. Although this works, it is not nice as the powershell script is not self-contained: one always needs to handle two files, the script as well as the template.
Therefore, I'm seeking for a way to bundle together the script and the Excel template. My first idea for this is to export the Excel template as a series of formatting commands. (This is similar to the result of a macro, where one obtains VBA code, but a macro is not maintainable: if I want to add one column, I'd need to repeat the whole macro.)
Ideally, with this I would like to have the example sheet exported into Powershell like
$sheet.cells.item(1,1) = 'Name'
$sheet.cells.item(1,1).font.Name = 'Calibri'
$sheet.cells.item(1,1).font.bold = $True
... and so on ...
(As said, Powershell would be optimal, but I could also arrange with VBA, why I tagged it as well.)
Is it possible to create such an export?
I have several reports that populate off the Form below. I would like to add a function for when a user uses the column Sort drop downs, the reports only look at the visible records.
So for example a report run while viewing the window below would return only files where the customer is named Placeholder.
Is there a simple way to do this with a macro or query without resorting to VBA?
This macro ended up working well.
I'm filling in a Word template with data that's been collected from user input. In particular a (variable) number of documents is chosen, and information about each document fills a row of a table.
I've bookmarked several items in the template and successfully filled information in the header from my macro, but the table I'm not so sure with. I bookmarked the first cell and tried tabbing (with Chr(9)) through, and also tried passing an array. (In the template the table has only a first row. Usually tabbing past the last column creates an additional row.)
I can retieve cell contents with
Word.Application.ActiveDocument.Tables(1).Cell(3, 1).Range.Text
but can't write to the any cell except the first, where I placed a bookmark.
Can anyone offer a possible solution to populate the table?
To populate table, use this code
ActiveDocument.Tables(1).Cell(1, 1).Range.Text = "Blah Blah"
This will write to the first cell in the first table. Use a loop to fill the rest of the cells.
I would also recommend see this link.
Topic: Automating Word Tables for Data Insertion and Extraction
Link: http://msdn.microsoft.com/en-us/library/aa537149%28v=office.11%29.aspx#Y1254
Extract:
Summary: Learn how to automate the creation and formatting of tables in Word. Get information about optimizing performance, populating a table with data, formatting table structure, linking table data, and extracting data from a table. (25 printed pages)
I've actually ran into a similar problem using Access to automate filling out a Word table template. I found that if I opened the template in Word prior to running the VBA script, then the Word document is successfully filled out with the table information. My code looks similar to yours as far as adding to it by row. Because the number of fields to be transferred to the form is dynamic it didn't seem like bookmarks for each section would work. If you have any update, I'd be happy to hear of a different way to resolve this.
I wrote a very simple drag and drop style report screen online so users can specify labels and fields etc much like an MS Access Report. I am having an issue getting this to output as PDF and I am using MigraDoc. The TextFrame allows you to specify a Left/Top which is good but I need to do this for multiple rows and I can't quite get it to work in this way.
At present I tried to add a table and a row (for each record) and put textframes within this with the left/top properties but every field gets put in the same place i.e. 0,0 and the records flow over both the header and footer?
I am using c#
I have a fairly simple MS Access Database that contains some metadata about a bunch of documents and a hyperlink field that links to the document on our network drive.
However, when I use a SQL INSERT statement to populate the hyperlink field, the value I give it only becomes the display text, not the actual link.
How can I make the value a functional hyperlink? I'd think that the hyperlink data type would actually create hyperlinks.
I'm using Access 2002 SP3.
I do not like hyperlink fields they are inconvenient and difficult to edit. It is much easier to use a text or memo field and use followhyperlink in the code for your form. That being said, the format for a hyperlink is:
DisplayPart#hyperlinkpart#
So
StackOverflow#http://stackoverflow.com#