[Archivesspace_Users_Group] Custom reports with string params?

Nick Butler npwb2 at cam.ac.uk
Mon Oct 5 05:02:21 EDT 2020


Hi Dave,

Thank you for this link, it's really helpful. I've installed your reports plugin on a dev system and am now hitting the same problem I'm having with my report - how to get the text box to show up on the report screen (i.e. what to put in the jobs/report_partials/_string partial). I tried just using the following line:

<% form.textfield name, nil, :class => 'text-field form-control' %>

But this leads to the attached being displayed instead of a text box! Might you be able to advise on how you were able to configure String parameter entry? It's not part of this plugin as far as I can see.

Many thanks,
Nick

________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Mayo, Dave <dave_mayo at harvard.edu>
Sent: 02 October 2020 17:07
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Custom reports with string params?


Hi,

We have a plugin we wrote with some custom SQL reports – this one uses a string parameter for an EADID or list of EADIDs - https://github.com/harvard-library/harvard_aspace_reports/blob/master/backend/model/resource_top_containers.rb

This is currently installed in production and working; it should be fine to install it and test locally or on a QA system, if you want to try it out in a live system.



--

Dave Mayo (he/him)

Senior Digital Library Software Engineer
Harvard University > HUIT > LTS



From: <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Karen Miller <k-miller3 at northwestern.edu>
Reply-To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Date: Friday, October 2, 2020 at 9:42 AM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] Custom reports with string params?



Hi Nick,



I have an SQL query that I’ve embedded into an Excel spreadsheet (as a .odc file) which prompts the user for a value. The value I’m prompting for is numeric, but the code could be adjusted to take a string. I don’t think this is what you want, but if it is, please let me know and I’ll forward the code.



Karen



From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> On Behalf Of Nick Butler
Sent: Friday, October 02, 2020 6:14 AM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: [Archivesspace_Users_Group] Custom reports with string params?



Hi all,



We've been asked to create a custom report that allows the user running it to input a string which is then used to search across various fields. I've checked through the pre-existing reports, and through several reports created by other institutions, but I haven't found an example of a report accepting a string parameter (only booleans and dates). I see from e.g. https://github.com/archivesspace/archivesspace/blob/75000415aa5ee60411c6caf012042af4fc157d00/frontend/app/views/jobs/_form.html.erb#L121<https://urldefense.com/v3/__https:/github.com/archivesspace/archivesspace/blob/75000415aa5ee60411c6caf012042af4fc157d00/frontend/app/views/jobs/_form.html.erb*L121__;Iw!!Dq0X2DkFhyF93HkjWTBQKhk!GX75QheNm0-XxIApINdOyeac54bS2ZjNyPlm_nxqTYFfTBABH9vDI0OxgolnoLIKYgcArjCl$> that it should be possible to use a custom partial for different data types but nothing I've tried has worked so far. Is anyone doing anything like this, and might they have an example of it working?



Many thanks!

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20201005/8827b72e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2020-10-05 10-01-15.png
Type: image/png
Size: 124413 bytes
Desc: Screenshot from 2020-10-05 10-01-15.png
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20201005/8827b72e/attachment.png>


More information about the Archivesspace_Users_Group mailing list