Mon Oct 5, 23:27Sergey Pariev
Thu Jul 30, 21:45
Just a quick note on odd MS Excel handling of links. I did some excel exporting recently and added links to our site’s password protected pages to the resulting xls file. And while links were opening in default browser (Firefox), they were redirected to the login page, regardless of all the session and ‘remember me’ cookies that were in the Firefox.
As it turned out, Excel uses some IE-related DLL (Hlink.dll, if anyone cares) to open links from its worksheets, so it can only use IE cookies. And if your default browser is not IE, sorry, you’re out of luck. Basically, KB article proposed two ways to deal with that – you can add some registry keys to force Excel to use default browser for links instead of Hlink.dll, or you can do client-side redirect. That would force the client to the default browser as well.
Since we clearly couldn’t expect our customers to fiddle with registry keys, I decided to go the second route. Problem was solved by adding special param (xls_link=true) to the generated links, and one more before_filter in application_controller.rb, which looks like this
Fri Mar 6, 16:58
Программирование — сложная штука, но многие из принципов, которые делают программиста лучше, не слишком отличаются от того, чему нас учили тети-воспитательницы.