CHAPTER 13 n TRACKING YOUR ADS WITH GOOGLE ADWORDS 280
Figure 13-5. AdWords reporter Excel report in Microsoft Excel
Figure 13-6. AdWords reporter Excel report in OpenOffice.org
CHAPTER 13 n TRACKING YOUR ADS WITH GOOGLE ADWORDS 281
This trick is perhaps the easiest way to add Excel views to your application. However,
note that you cannot use spreadsheet-specific features like formulas with this technique.
Another odd consequence is that if the user modifies the spreadsheet and then saves it,
the spreadsheet will still be saved in HTML format, even though it has an Excel extension.
This could conceivably be a problem if the user wants to import the file into an application
and expects a genuine Excel-format file. (If you are writing the application into
which they will import such a file, you could simply write the importer to expect HTML
as input.)
The application has two views: index.rhtml, which simply displays a form and is selfexplanatory,
and report.rhtml (Listing 13-6), which begins like this:
Google AdWords Campaign Plan
<%unless @excel_view %>
<%=link_to '[download as excel]',
:params=>{
'view_as_excel'=>true,
'report[target_clicks]'=>@target_clicks
}
%>
<%end%>
The link to download the page as an Excel file is visible unless the current page is
already in Excel format.
Pages:
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398