Home » Archived » BIRT » Hyperlinks created in xls file are invalid
Hyperlinks created in xls file are invalid [message #778831] |
Fri, 13 January 2012 18:00  |
Eclipse User |
|
|
|
Hi, I have a report design that contains several tables. And I have created bookmarks and hyperlinks so that the user can navigate from one cell of a table to another cell in another table.
This works fine for html, pdf, and doc outputs. However, for the xls (Excel) output, when the user clicks on the link, it says the link is invalid.
Is this supported?
If required, I can post a design and a data source.
Please help!
Thanks,
Joseph
|
|
|
Re: Hyperlinks created in xls file are invalid [message #780375 is a reply to message #778831] |
Tue, 17 January 2012 12:20   |
Eclipse User |
|
|
|
Joseph,
Can you open a bugzilla entry for this? As a work around try using the
bookmark and table of contents expressions for the target. I have
created and example that works in xls and attached it. The grey
background data item has the hyperlink and the target data item is in
red and uses a bookmark and table of contents expression.
Jason
On 1/13/2012 6:00 PM, Joseph Yeh wrote:
> Hi, I have a report design that contains several tables. And I have
> created bookmarks and hyperlinks so that the user can navigate from one
> cell of a table to another cell in another table.
> This works fine for html, pdf, and doc outputs. However, for the xls
> (Excel) output, when the user clicks on the link, it says the link is
> invalid.
>
> Is this supported?
> If required, I can post a design and a data source.
>
> Please help!
>
> Thanks,
> Joseph
|
|
|
Re: Hyperlinks created in xls file are invalid [message #780377 is a reply to message #778831] |
Tue, 17 January 2012 12:20   |
Eclipse User |
|
|
|
Joseph,
Can you open a bugzilla entry for this? As a work around try using the
bookmark and table of contents expressions for the target. I have
created and example that works in xls and attached it. The grey
background data item has the hyperlink and the target data item is in
red and uses a bookmark and table of contents expression.
Jason
On 1/13/2012 6:00 PM, Joseph Yeh wrote:
> Hi, I have a report design that contains several tables. And I have
> created bookmarks and hyperlinks so that the user can navigate from one
> cell of a table to another cell in another table.
> This works fine for html, pdf, and doc outputs. However, for the xls
> (Excel) output, when the user clicks on the link, it says the link is
> invalid.
>
> Is this supported?
> If required, I can post a design and a data source.
>
> Please help!
>
> Thanks,
> Joseph
|
|
| | | | | | | | |
Re: Hyperlinks created in xls file are invalid [message #780869 is a reply to message #780620] |
Thu, 19 January 2012 13:34   |
Eclipse User |
|
|
|
You could see if the 3.7 xls emitter will work in 2.6.2. The changes
appear to all be in ExcelXmlWriter.java
Version 2.6.2 code in ExcelXmlWriter.java
private void outputBookmarks( HashMap<String, BookmarkDef> bookmarkList )
{
if ( !bookmarkList.isEmpty( ) )
{
writer.openTag( "Names" );
Set<Entry<String, BookmarkDef>> bookmarkEntry = bookmarkList
.entrySet( );
for ( Entry<String, BookmarkDef> bookmark : bookmarkEntry )
defineNames( bookmark );
writer.closeTag( "Names" );
}
}
private void defineNames( Entry<String, BookmarkDef> bookmarkEntry )
{
BookmarkDef bookmark = bookmarkEntry.getValue( );
String name = bookmark.getValidName( );
String refer = getRefer( bookmark.getSheetIndex( ), bookmark );
defineName( name, refer );
}
private String getRefer( int sheetIndex, BookmarkDef bookmark )
{
StringBuffer sb = new StringBuffer( "=Sheet" );
sb.append( sheetIndex );
sb.append( "!R" );
sb.append( bookmark.getRowNo( ) );
sb.append( "C" );
sb.append( bookmark.getColumnNo( ) );
return sb.toString( );
}
private void defineName( String name, String refer )
{
writer.openTag( "NamedRange" );
writer.attribute( "ss:Name", name );
writer.attribute( "ss:RefersTo", refer );
writer.closeTag( "NamedRange" );
}
Version 3.7.1 code in ExcelXmlWriter.java
private void outputBookmarks( HashMap<String, BookmarkDef> bookmarkList )
{
if ( !bookmarkList.isEmpty( ) )
{
writer.openTag( "Names" );
for ( Entry<String, BookmarkDef> entry : bookmarkList.entrySet( ) )
{
BookmarkDef bookmark = entry.getValue( );
defineName( bookmark.getValidName( ), getRefer( bookmark ) );
}
writer.closeTag( "Names" );
}
}
private String getRefer( BookmarkDef bookmark )
{
StringBuffer buffer = new StringBuffer( '=' );
buffer.append( bookmark.getSheetName( ) );
buffer.append( "!" );
int startColumn = bookmark.getStartColumn( );
int startRow = bookmark.getStartRow( );
addCellPosition( buffer, startColumn, startRow );
int endColumn = bookmark.getEndColumn( );
int endRow = bookmark.getEndRow( );
if ( endRow != -1 && endColumn != -1 && startRow != endRow
&& startColumn != endColumn )
{
buffer.append( ':' );
addCellPosition( buffer, endColumn, endRow );
}
return buffer.toString( );
}
private void defineName( String name, String refer )
{
writer.openTag( "NamedRange" );
writer.attribute( "ss:Name", name );
writer.attribute( "ss:RefersTo", refer );
writer.closeTag( "NamedRange" );
}
Jason
On 1/18/2012 2:34 PM, Joseph Yeh wrote:
> Hi Jason,
>
> Thanks for the answers. Do you suggest that I open a bugzilla entry
> against BIRT 2.6.2 to change the xls emitter as you pointed out? Or will
> it be a small change to some code in BIRT 2.6.2 that a patch can be
> created for? Would it be possible that you send me such a patch
> including the source code? I guess there is no other way to work around
> this issue, right?
>
> Thanks,
> Joseph
|
|
| |
Goto Forum:
Current Time: Thu Jul 03 11:05:31 EDT 2025
Powered by FUDForum. Page generated in 1.06898 seconds
|